Changeset View
Changeset View
Standalone View
Standalone View
src/formatstrings.cpp
Show First 20 Lines • Show All 143 Lines • ▼ Show 20 Line(s) | |||||
144 | QString FormatStrings::formatAsMeter(const QVariant& value) | 144 | QString FormatStrings::formatAsMeter(const QVariant& value) | ||
145 | { | 145 | { | ||
146 | KFormat form; | 146 | KFormat form; | ||
147 | return form.formatValue(value.toDouble(), KFormat::Unit::Meter, 1, KFormat::UnitPrefix::AutoAdjust, KFormat::MetricBinaryDialect); | 147 | return form.formatValue(value.toDouble(), KFormat::Unit::Meter, 1, KFormat::UnitPrefix::AutoAdjust, KFormat::MetricBinaryDialect); | ||
148 | } | 148 | } | ||
149 | 149 | | |||
150 | QString FormatStrings::formatAsFrameRate(const QVariant& value) | 150 | QString FormatStrings::formatAsFrameRate(const QVariant& value) | ||
151 | { | 151 | { | ||
152 | return QString(value.toString() + i18nc("Symbol of frames per second, with space", " fps")); | 152 | return i18nc("Symbol of frames per second, with space", "%1 fps", round(value.toDouble() * 100) / 100); | ||
bruns: No concatenation please, see
https://techbase.kde. | |||||
153 | } | 153 | } |
No concatenation please, see
https://techbase.kde.org/Development/Tutorials/Localization/i18n_Krazy#Number_Formatting