c# - How to show entire Decimal -



c# - How to show entire Decimal -

i have variable this:

string energya14 = "0.17"; //kwh

which add together property so:

energya14 = convert.todecimal(energya14)

but when print out shows 17 want show 0.17

how create entire decimal shown?

thanks help in advance.

i guess it's problem of used culture. . not interpreted decimal delimiter, resulting number 17.000.

try utilize other overload of convert.todecimal , utilize invariant culture:

energya14 = convert.todecimal(energya14, cultureinfo.invariantinfo)

same decimal.tryparse:

decimal.tryparse(energya14, numberstyles.float, cultureinfo.invariantinfo, out energya14)

c# decimal converter

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -