powered by
Formats numeric column y to a format like '#,###,###.##', rounded to x decimal places, and returns the result as a string column.
format_number(y, x)# S4 method for Column,numeric format_number(y, x)
# S4 method for Column,numeric format_number(y, x)
column to format
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.
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
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) # }
Run the code above in your browser using DataLab