Closed Delja closed 5 years ago
To my knowledge, there is no language that specifically provides a method for returning a string with scientific notation. Generally the conversion is done using a user-specified format. The best solution would be to define a more verbose name. Example to_s_expo_notation
or something else.
@Morriar Your link it's for returns a float multiplied by the specified power. The objective of this pr is to provide a method to return a string representing a float in a scientific notation.
May I suggest something like to_sci
for the name? Bit more concise than to_scientific_notation
, and slightly more explicit than to_se
in my eyes
@R4PaSs nice, the to_sci
look good, but to_scientific_notation
it's also correct.
@privat what do you prefers?
+0.1e1 for to_sci
Add a method
to_se
to get the string representation of float in scientific notation.The to_se method have a precision between 1 to 6 max decimal. The precision is adapted in function of the number.
Add a
to_precision_size_with_format
andto_precision_fill_with_format
method to get the representation in a specific given format