c# - Take 4 places after decimal for a double variable -
this question has answer here:
- limiting double 3 decimal places 8 answers
- truncate number of digit of double value in c# 10 answers
i dont want round want take 4 places after decimal.
example:
double = 0.00038;
i want result
0.0003 // 8 discarded
how can achieve that?
double result = math.truncate(10000 * something) / 10000;
Comments
Post a Comment