hologram icon indicating copy to clipboard operation
hologram copied to clipboard

Support the rest of options in :erlang.float_to_binary/2

Open bartblast opened this issue 1 month ago • 1 comments

Option :short is already supported.

Options to support:

:decimals If option decimals is specified, the returned value contains at most Decimals number of digits past the decimal point. If the number does not fit in the internal static buffer of 256 bytes, the function throws badarg.

:compact If option compact is specified, the trailing zeros at the end of the list are truncated. This option is only meaningful together with option decimals.

:scientific If option scientific is specified, the float is formatted using scientific notation with Decimals digits of precision.

See section "Available options" in :erlang.float_to_list/2 docs (the behaviour is the same for :erlang.float_to_binary/2): https://www.erlang.org/doc/apps/erts/erlang.html#float_to_list/2

bartblast avatar Nov 18 '25 20:11 bartblast