string_formatter¶
- concreteproperties.post.string_formatter(value: float, eng: bool, prec: int, scale: float = 1.0) str[source]¶
Formats a float using engineering or fixed notation.
- Parameters:
value (float) – Number to format
eng (bool) – If set to
True, formats with engineering notation. If set toFalse, formats with fixed notation.prec (int) – The desired precision (i.e. one plus this value is the desired number of digits)
scale (float) – Factor by which to scale the value. Defaults to
1.0.
- Returns:
Formatted string
- Return type: