mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-04-06 06:53:37 +00:00
Improve graph axis labeling
- Use correct Y height to display full font - Fix floating point issue when calculating amount of displayed digits in Unit::ToString
This commit is contained in:
parent
5f022c42b6
commit
1aaba21723
4 changed files with 15 additions and 15 deletions
|
|
@ -46,7 +46,7 @@ QString Unit::ToString(double value, QString unit, QString prefixes, int precisi
|
|||
value = -value;
|
||||
}
|
||||
int prefixIndex = 0; //prefixes.indexOf(' ');
|
||||
int preDotDigits = log10(value / SIPrefixToFactor(prefixes[prefixIndex].toLatin1())) + 1;
|
||||
int preDotDigits = log10(value / SIPrefixToFactor(prefixes[prefixIndex].toLatin1())) + (1.0-log10(0.5));
|
||||
while(preDotDigits > 3 && prefixIndex < prefixes.length() - 1) {
|
||||
prefixIndex++;
|
||||
preDotDigits = log10(value / SIPrefixToFactor(prefixes[prefixIndex].toLatin1())) + 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue