How to convert Double to Float Value

Hi guys.I have a value ‘61.7’ of type Double.I need to change this value to ‘61.70’.Can anyone help me with this.

@sandhyak9 check this Data Conversion from String to Double


Can you take the value 61.7 as a string and take the length of the string and if the length of the string is 4 append a 0 at last of the string.

Create one string Variable.
Assign - strValue = string.Format("{0:0.00}", 11.6)

you will get 11.60 as output.This method will give you the output upto two decimal places.

** you can pass your double variable in place of 11.6 .

HI sandhya,
datatype double has 15 decimal digits of precision. if you want 61.70 then convert 61.7 into string and concantenate with 0…

Thank you @syedabidraza for your valuable reply

Thank you everyone for your valuable replies.Every solution is working

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