float
float f = 10.123456F;
float fc = (float)Math.Round(f * 100f) / 100f;
Double
Double d = 100.123456;
Double dc = Math.Round((Double)d, 2);
Decimal
decimal d = 100.123456M;
decimal dc = Math.Round(d, 2);
Source : Jeery
Develop games in your browser. Powerful, performant & highly capable.
Member since 1 Dec, 2015