Commit 5837e7604909cb5587356ebd8cb847e0d005c55f

Authored by David Gräff
1 parent c75163cf

Fix utf8 problem with a character

Signed-off-by: David Gräff <david.graeff@web.de>
Showing 1 changed file with 3 additions and 3 deletions
openhantek/src/helper.cpp
@@ -83,7 +83,7 @@ namespace Helper { @@ -83,7 +83,7 @@ namespace Helper {
83 // Voltage string representation 83 // Voltage string representation
84 int logarithm = floor(log10(fabs(value))); 84 int logarithm = floor(log10(fabs(value)));
85 if(value < 1e-3) 85 if(value < 1e-3)
86 - return QApplication::tr("%L1 \265V").arg(value / 1e-6, 0, format, (precision <= 0) ? precision : qBound(0, precision - 7 - logarithm, precision)); 86 + return QApplication::tr("%L1 µV").arg(value / 1e-6, 0, format, (precision <= 0) ? precision : qBound(0, precision - 7 - logarithm, precision));
87 else if(value < 1.0) 87 else if(value < 1.0)
88 return QApplication::tr("%L1 mV").arg(value / 1e-3, 0, format, (precision <= 0) ? precision : (precision - 4 - logarithm)); 88 return QApplication::tr("%L1 mV").arg(value / 1e-3, 0, format, (precision <= 0) ? precision : (precision - 4 - logarithm));
89 else 89 else
@@ -100,7 +100,7 @@ namespace Helper { @@ -100,7 +100,7 @@ namespace Helper {
100 else if(value < 1e-6) 100 else if(value < 1e-6)
101 return QApplication::tr("%L1 ns").arg(value / 1e-9, 0, format, (precision <= 0) ? precision : (precision - 10 - (int) floor(log10(fabs(value))))); 101 return QApplication::tr("%L1 ns").arg(value / 1e-9, 0, format, (precision <= 0) ? precision : (precision - 10 - (int) floor(log10(fabs(value)))));
102 else if(value < 1e-3) 102 else if(value < 1e-3)
103 - return QApplication::tr("%L1 \265s").arg(value / 1e-6, 0, format, (precision <= 0) ? precision : (precision - 7 - (int) floor(log10(fabs(value))))); 103 + return QApplication::tr("%L1 µs").arg(value / 1e-6, 0, format, (precision <= 0) ? precision : (precision - 7 - (int) floor(log10(fabs(value)))));
104 else if(value < 1.0) 104 else if(value < 1.0)
105 return QApplication::tr("%L1 ms").arg(value / 1e-3, 0, format, (precision <= 0) ? precision : (precision - 4 - (int) floor(log10(fabs(value))))); 105 return QApplication::tr("%L1 ms").arg(value / 1e-3, 0, format, (precision <= 0) ? precision : (precision - 4 - (int) floor(log10(fabs(value)))));
106 else if(value < 60) 106 else if(value < 60)
@@ -209,7 +209,7 @@ namespace Helper { @@ -209,7 +209,7 @@ namespace Helper {
209 return value * 1e-12; 209 return value * 1e-12;
210 else if(unitString.startsWith('n')) 210 else if(unitString.startsWith('n'))
211 return value * 1e-9; 211 return value * 1e-9;
212 - else if(unitString.startsWith('\265')) 212 + else if(unitString.startsWith('µ'))
213 return value * 1e-6; 213 return value * 1e-6;
214 else if(unitString.startsWith("min")) 214 else if(unitString.startsWith("min"))
215 return value * 60; 215 return value * 60;