Main Site Documentation

double.TOString on ChipworkX screen give to much numbers


#1

Hi, I like do some calculation with double values. Example double G1 = 97.33;
This give to much numbers on the ChipworkX Screen like 97.3299999999 :frowning:
How can I less amount of number?
Thanks


#2

Something like:
String.Format("{0:0.00}", G1); //97.33
or
G1.ToString(β€œd2”);
or
G1.ToString(β€œN2”); //97.32

Im not shure if this work on .NETMF but on normal .NET work.


#3

Thanks Dejan, It’s runs now nice. I use x.ToString(β€œN2”); and the TFT screen shows 97.33