hey!
i got a problem with a decimal...
theres a decimal: 190,2375 (NOT always with theese numbers!)
how can i make it: 190,24 ?????
thankz!
Printable View
hey!
i got a problem with a decimal...
theres a decimal: 190,2375 (NOT always with theese numbers!)
how can i make it: 190,24 ?????
thankz!
Well there is Math.Round() for rounding decimals but those are commas.... I don't think there is any built in functions for rounding off values with commas. Did you mean decimals and accidently put commas or vice versa?
thanks for replying!
the problem is that i want only 2 decimals, i mean the numbers after comma...
*,???? to
*,??
round makes 14,683 15....
thanks
Two decimal places:-
label1.text = yourvariablename.tostring("#.00")
God bless you mrcrash!!!!
THANKS!!!
The commas wouldn't matter correct?? Its just that the "decimal" value is represented as a comma on his computer setting, so it should still work...
To aggregate the solutions provided so far, if you want the result to be a Decimal then use Math.Round. If you want the result to be a String then use ToString, although I'd go with "n2" as the parameter. Same result, just using a standard format string instead of a custom one.