Format the number 0.5 into a percentage value:
x = format(0.5, '%')
The format()
function formats a specified value into a specified format.
'<'
- Left aligns the result (within the available space)
'>'
- Right aligns the result (within the available space)
'^'
- Center aligns the result (within the available space)
'='
- Places the sign to the left most position
'+'
- Use a plus sign to indicate if the result is positive or negative
'-'
- Use a minus sign for negative values only
' '
- Use a leading space for positive numbers
','
- Use a comma as a thousand separator
'_'
- Use a underscore as a thousand separator
'b'
- Binary format
'c'
- Converts the value into the corresponding unicode character
'd'
- Decimal format
'e'
- Scientific format, with a lower case e
'E'
- Scientific format, with an upper case E
'f'
- Fix point number format
'F'
- Fix point number format, upper case
'g'
- General format
'G'
- General format (using a upper case E for scientific notations)
'o'
- Octal format
'x'
- Hex format, lower case
'X'
- Hex format, upper case
'n'
- Number format
'%'
- Percentage format More Examples
Track your progress - it's free!
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4