float_formatter
-
compas.numerical.
float_formatter
(x)[source] Formats float to truncated string.
- Parameters
x (float) â Input float.
- Returns
str â Truncated string with default precision .2f.
Notes
stackoverflow.com/questions/21008858/formatting-floats-in-a-numpy-array float_formatter = lambda x: â%.2fâ % x
Examples
>>> float_formatter(3.14159265359) '+3.14'