Skip to content
Chris Petersen edited this page Oct 16, 2014 · 1 revision

float->string converts a float to string. This version show up to precision digits beyond the decimal point.

Parameter Description
x Floating point number
p Precision

Example

Example 1: Convert the number 100.513 to a string with 2 digits of precision

> (float->string 100.513 2)
"100.51"

Example 2: Convert the number 7.3 to a string with 2 digits of precision

> (float->string 7.3 2)
"7.3"

Example 3: Convert the number 3 to a string with 2 digits of precision

> (float->string 3 2)
"3"
Clone this wiki locally