ocean
ocean copied to clipboard
Replace format function in ocean.text.convert.Float
The ocean.text.convert.Float
module defines a specialized format
function that writes a formatted string of a floating point number into a provided buffer. This is used under the hood in ocean.text.convert.Formatter
to handle floating-point values.
However, having this separate public format
definition produces a naming clash any time anyone wants to import both ocean.text.convert.Float
and ocean.text.convert.Formatter
(e.g. if one wants to use, say, toFloat
from the former and format
from the second).
It would be better to bring floating-point formatting in under the hood inside Formatter
and to deprecate the function in the Float
module. In this way, Formatter
becomes the single point of access for formatting variables to strings, while Float
can concentrate on converting text to floating-point values.
Note, downstream users of ocean.text.convert.Float.format
ought to be able to use snformat
(from the Formatter
module) as a replacement for all their use-cases.