format_number {SparkR} | R Documentation |
Formats numeric column y to a format like '#,###,###.##', rounded to x decimal places with HALF_EVEN round mode, and returns the result as a string column.
format_number(y, x) ## S4 method for signature 'Column,numeric' format_number(y, x)
y |
column to format |
x |
number of decimal place to format to |
If x is 0, the result has no decimal point or fractional part. If x < 0, the result will be null.
format_number since 1.5.0
Other string_funcs: ascii
,
base64
, concat_ws
,
concat
, decode
,
encode
, format_string
,
initcap
, instr
,
length
, levenshtein
,
locate
, lower
,
lpad
, ltrim
,
regexp_extract
,
regexp_replace
, reverse
,
rpad
, rtrim
,
soundex
, substring_index
,
translate
, trim
,
unbase64
, upper
## Not run: format_number(df$n, 4)