A float type data turning string in Java

zhaozj2021-02-16  80

Java.text.Numberformat Formater = java.text.decimalformat.getInstance ();

Formater.SetMaximumumfractionDigits (2);

Formater.setminimumfractiondigits (2);

Formater.format (a);

[In the masterpiece of Magicxxxxxxxx (MAGIC):]

: float a = 3.7777777777

: How to cut off as a string 3.78? ?

转载请注明原文地址:https://www.9cbs.com/read-12538.html

New Post(0)