Logo

Programming-Idioms

History of Idiom 65 > diff from v9 to v10

Edit summary for version 10 by :

Version 9

2015-08-20, 15:47:54

Version 10

2015-08-21, 14:59:59

Idiom #65 Format decimal number

From real value x in [0,1], create its percentage string representation s with one digit after decimal point. E.g. 0.15625 -> "15.6%"

Idiom #65 Format decimal number

From real value x in [0,1], create its percentage string representation s with one digit after decimal point. E.g. 0.15625 -> "15.6%"

Imports
SysUtils
Code
s :=format('%.1f%%', [100.0*x]);