Hi everyone,
I am using a AI model to extract information from an invoice document.
One of the extracted informations is the total value of the invoice, the extracted information as value is a total number, but the text result is the actual correct output since it´s providing the currency and the comma.
I now want to use the extracted text, convert it to int to use it in a condition to check, so if the amount is higher then 1000 a specific action has to happen.
Can anyone help me in setting up the correct flow?
Hi @lisa_garcia ,
Try below and you can get the currency:
formatNumber(float(substring(outputs('Compose'),0,sub(length(outputs('Compose')),1))),'$ #,###.00')
Best regards,
Hi @v-jefferni
thanks so much for helping me!
So I´m geeting a result, but still missing the two digits.. How do I get the number right?
Tried float but it isn´t working...
regards
Hi @lisa_garcia ,
Just need to extract substring from the first digit:
int(substring(outputs('Verfassen'),0,sub(length(outputs('Verfassen')),1)))
Best regards,
Hi @lisa_garcia ,
So, the currency symbol is in the end. You can edit the expression as follow:
int(substring(outputs('Verfassen'),1,sub(length(outputs('Verfassen')),1)))
Best regards,
Hi @v-jefferni
I tried your solution but get another error:
the compose 2 looks like this:
Hi @lisa_garcia ,
To convert currency string to number, you need below expression:
int(substring(outputs('Compose'),2,sub(length(outputs('Compose')),2)))
Best regards,
WarrenBelz
146,605
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,946
Most Valuable Professional