Add negative support to si_string (closes #1396)
This commit is contained in:
parent
a305d99972
commit
f5991ecb48
1 changed files with 4 additions and 0 deletions
|
@ -535,6 +535,10 @@ std::string si_string(double input, bool base2, const std::string& unit) {
|
|||
|
||||
typedef std::array<std::string, 9> strings9;
|
||||
|
||||
if(input < 0){
|
||||
return font::unicode_minus + si_string(std::abs(input), base2, unit);
|
||||
}
|
||||
|
||||
strings9 prefixes;
|
||||
strings9::const_iterator prefix;
|
||||
if (input == 0.0) {
|
||||
|
|
Loading…
Add table
Reference in a new issue