Numbers with digits (A1/A2) were not played correctly with TTS (done only french)

This commit is contained in:
bsongis
2012-07-24 20:53:01 +00:00
parent effdd542ca
commit a5112d2463
2 changed files with 14 additions and 4 deletions
+10
View File
@@ -49,6 +49,7 @@ enum FrenchPrompts {
PROMPT_SOIXANTE_ET_ONZE = 109,
PROMPT_QUATRE_VINGT_UNE = 110,
PROMPT_VIRGULE = 116,
PROMPT_ET = 117,
PROMPT_MOINS = 118,
@@ -115,6 +116,15 @@ void playNumber(int16_t number, uint8_t unit, uint8_t att)
prompts.append(Prompt(GUIDE_00_MILLION, dir=2))
*/
int8_t mode = MODE(att);
if (mode > 0) {
div_t qr = div(number, (mode == 1 ? 10 : 100));
playNumber(qr.quot);
pushPrompt(PROMPT_VIRGULE);
playNumber(qr.rem, unit);
return;
}
if (number < 0) {
pushPrompt(PROMPT_MOINS);
number = -number;