In DbU.getValueString(), use 'L' for lambdas ('l' too close of '1').

This commit is contained in:
Jean-Paul Chaput 2020-11-11 13:40:58 +01:00
parent d37970d184
commit 266409acc4
1 changed files with 13 additions and 14 deletions

View File

@ -32,7 +32,6 @@
#include <cstring> #include <cstring>
#include <cstdlib> #include <cstdlib>
#include <limits> #include <limits>
#include "hurricane/DbU.h" #include "hurricane/DbU.h"
#include "hurricane/Error.h" #include "hurricane/Error.h"
#include "hurricane/DataBase.h" #include "hurricane/DataBase.h"
@ -310,8 +309,8 @@ namespace Hurricane {
unitSymbol = 'g'; unitSymbol = 'g';
os << setprecision(1) << toGrid(u); os << setprecision(1) << toGrid(u);
} else if (_stringMode == Symbolic) { } else if (_stringMode == Symbolic) {
unitSymbol = 'l'; unitSymbol = 'L';
os << setprecision(1) << toLambda(u); os << setprecision(2) << toLambda(u);
} else if (_stringMode == Physical) { } else if (_stringMode == Physical) {
unitSymbol = 'm'; unitSymbol = 'm';
switch ( _stringModeUnitPower ) { switch ( _stringModeUnitPower ) {
@ -332,13 +331,14 @@ namespace Hurricane {
} else { } else {
if (_stringMode != Db) if (_stringMode != Db)
cerr << "[ERROR] Unknown Unit representation mode: " << _stringMode << endl; cerr << "[ERROR] Unknown Unit representation mode: " << _stringMode << endl;
os << u; os << u;
} }
string s = os.str(); string s = os.str();
if (mode & SmartTruncate) { if (_stringMode == Symbolic) {
size_t dot = s.rfind( '.' );
if (dot != string::npos) s.erase( dot + 1 );
} else if (mode & SmartTruncate) {
size_t dot = s.rfind( '.' ); size_t dot = s.rfind( '.' );
if (dot != string::npos) { if (dot != string::npos) {
size_t end = dot+1; size_t end = dot+1;
@ -346,7 +346,6 @@ namespace Hurricane {
if (end == s.size()) s.erase( dot ); if (end == s.size()) s.erase( dot );
} }
} }
if (unitPower != ' ') s += unitPower; if (unitPower != ' ') s += unitPower;
s += unitSymbol; s += unitSymbol;