float string - part-cw/lambdanative GitHub Wiki
(float->string x p)
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"