CDBL is not working for this currency format - 10.250,00

Any suggestion would be good - CDBL is not working for this currency format - 10.250,00 for this double characters

Hi @Sathish_Kumar5

Could you specify what you want to exactly achieve

Regards
PS Parvathy

1 Like

Hi @Sathish_Kumar5

CDBL cannot convert 10.250,00 because it uses European formatting. Replace the thousand separator and decimal separator before conversion, for example:

CDbl(value.Replace(β€œ.”, β€œβ€).Replace(β€œ,”, β€œ.”))

This converts 10.250,00 β†’ 10250.00, and CDBL will work correctly.

If helpful, mark as solution. Happy automation with UiPath

1 Like

@Sathish_Kumar5

Replacing etc is not the right way

you need to specify the culture to convert it. May be your system location is US so it expects in same format..if you want to parse any other format you can specify it

double.Parse("10.250,00", System.Globalization.CultureInfo.GetCultureInfoByIetfLanguageTag("de-DE"))

cheers

2 Likes

Hi,

FYI, another approach:

Call the following expression in advance, then use CDbl

System.Globalization.CultureInfo.CurrentCulture = New System.Globalization.CultureInfo("es-ES")

Please note that this way also affects all the locale settings such as DateTime etc., in the thread.

Regards,

3 Likes

Hi @Sathish_Kumar5

Cdbl will not work for the currency :heavy_dollar_sign: format 10250.00

It happens due to the cdbl is depend on the culture info
For this you can try below approach use linq functionality in UiPath
Use assign inside put

currencyamount = Double.Parse(Inputstring,System.Globalization.CultureInfo.GetCultureInfo(β€œde-DE”))
Then use if condition you will get your result properly.
Hope it works with you!

1 Like

Thanks for the huge response

1 Like

yes it helps, thank you so much

Thanks for the response

1 Like

thanks for the response

thanks for the response @Parvathy

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.