I have number that i need to convert into decimal?

I have case that i need to convert that number into decimal ie., 108323443 this number i need to convert into decimal like 10.8 how to do this i had done using convert.Todecimal(number) which does not working

Hi @naveen5

Try this:

originalNumber= 108323443
decimalFormatted= (Convert.ToDecimal(originalNumber) / 10000000).ToString("F1")


Regards

hi varun why we need .Tostring(“F1”)

Hi @naveen5

The result of the division is then converted to a string using the ToString method with the format specifier "F1". "F1" specifies that the string representation should have one digit after the decimal point.

Regards

1 Like

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