DecimalFormat usage summary

effect

Formatting numbers

usage

With 0or #formatted

At 0the time fill the seats:

  1. If the number is less, to make up 0, decimals, and integers will fill.
  2. If the number is more, it cut off, but only cut the end of decimals, integers can not be cut.
  3. While the number of decimal places to be cut off will be rounded off.

At #the time fill the seats:

  1. If the number is less, it does not deal with.
  2. If the number is more, it cut off, but only cut the end of decimals, integers can not be cut.
  3. While the number of decimal places to be cut off will be rounded off.

Guess you like

Origin www.cnblogs.com/JMWan233/p/11908386.html