[問題] DecimalFormat中的 format method
剛剛在看 Absolute Java 第二章的時候有個部分看不太懂@@
用class DecimalFormat 中的method format時
若pattern 為 "##0.##E0" 輸入為12345 則輸出為:12.3E3
以下為課文描述片段:
the minimum number of significant digits in the mantissa(that is,
the sum of the number of digits before and after the dicimal point)
is the minimum of the number of digits indicated before the decimal
point plus the maximum of the number of digits indicated after the
decimal point.
我知道#,0,E 各自的意義
例如 pattern 為 "000.000" 輸入為12.3456 則輸出為:012.346
原文每個字都懂 可是不太了解他的意思@@
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 36.237.117.225
java 近期熱門文章
PTT數位生活區 即時熱門文章