Merge: Abstract_text: Add a method to get string representation of float in scientifi...
authorJean Privat <jean@pryen.org>
Fri, 23 Aug 2019 13:25:19 +0000 (09:25 -0400)
committerJean Privat <jean@pryen.org>
Fri, 23 Aug 2019 13:25:19 +0000 (09:25 -0400)
commitb6f6d5858cc7754fb336ecf08def07c698b908ab
tree5912db9b6e47b2f0f9a7fe21b871a303015bbf50
parent207b7f4bae6e693ead4d3f4f7184b48df2a3f432
parentd334734649f69e5e1d07f41a70750575022164e3
Merge: Abstract_text: Add a method to get string representation of float in scientific notation

Add a method `to_se` to get the string representation of float in scientific notation.
```
123.45.to_se == "1.2345e+02"
0.001234.to_se  == "1.234e-03"
10860460000.0.to_se == "1.086046e+10"
```
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` and `to_precision_fill_with_format` method to get the representation in a specific given format

Pull-Request: #2785
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Jean Privat <jean@pryen.org>