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
Post a Comment