N
Negr0
Gast
Hi,
wie kann ich eine Float zahl auf eine Stelle nach dem Komma runden?
Also z.B. 2.5623423423 auf 2.6
wie kann ich eine Float zahl auf eine Stelle nach dem Komma runden?
Also z.B. 2.5623423423 auf 2.6
float x = ...
x = Math.round( x * 100f ) / 100f;
double x = 5.54;
return Math.round( x * 10f ) / 10f;
double x = 5.56;
x = Math.round( x * 10.0 ) / 10.0;