Commit 236b326a authored by DonLakeFlyer's avatar DonLakeFlyer

Fix decimal point bugs found by unit test

parent 771f6409
......@@ -135,12 +135,12 @@ QString AudioOutput::fixTextMessageForAudio(const QString& string) {
}
// Convert real number with decimal point
re.setPattern(QStringLiteral("([0-9]*)(\\.)([0-9]*)"));
re.setPattern(QStringLiteral("([0-9]+)(\\.)([0-9]+)"));
reMatch = re.match(result);
while (reMatch.hasMatch()) {
if (!reMatch.captured(2).isNull()) {
// There is a decimal point
result.replace(reMatch.capturedStart(2), reMatch.capturedEnd(2) - reMatch.capturedStart(2), tr(" point"));
result.replace(reMatch.capturedStart(2), reMatch.capturedEnd(2) - reMatch.capturedStart(2), tr(" point "));
}
reMatch = re.match(result);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment