Remove zeroes after decimal place

Hi all,

I need to remove zeroes after decimal places
Example : input 123.37000
Output 123.37

Thanks

Hi @Bhjanga_Prabhu

Check this out

System.Text.RegularExpressions.Regex.Replace(yourString,“.0+\b|(?<=.\d*?)0+\b”,“”)

1 Like

Hi Try this
YourNumber.tostring(“0.00”)

thanks

Hey @Bhjanga_Prabhu ,

You can use the below examples.

String.Format(“{0:0.00}”, 123.4567);-----“123.46”
String.Format(“{0:0.00}”, 123.4);-----“123.40”
String.Format(“{0:0.00}”, 123.0);-----“123.00”

Thanks,
Sanjit

Hi,

FYI, another approach:

image

CDbl(yourString).ToString

Regards,

Hi @Bhjanga_Prabhu

Welcome to UiPath community

Another approach by using Regex expression

System.Text.RegularExpressions.Regex.Replace("YourString","0+$","")

image

Regards
Gokul

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