summaryrefslogtreecommitdiff
path: root/apps/talk.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/talk.c')
-rw-r--r--apps/talk.c45
1 files changed, 36 insertions, 9 deletions
diff --git a/apps/talk.c b/apps/talk.c
index 73191c22c3..e627337162 100644
--- a/apps/talk.c
+++ b/apps/talk.c
@@ -1188,17 +1188,44 @@ int talk_number(long n, bool enqueue)
1188 talk_id(VOICE_HUNDRED, true); 1188 talk_id(VOICE_HUNDRED, true);
1189 } 1189 }
1190 1190
1191 /* combination indexing */ 1191 struct queue_entry tens_swap;
1192 if (ones > 20) 1192 if (get_clip(VOICE_NUMERIC_TENS_SWAP_SEPARATOR, &tens_swap) >= 0)
1193 { 1193 {
1194 int tens = ones/10 + 18; 1194 /* direct indexing */
1195 talk_id(VOICE_ZERO + tens, true); 1195 if (ones <= 20)
1196 ones %= 10; 1196 {
1197 talk_id(VOICE_ZERO + ones, true);
1198 }
1199 else if (ones)
1200 {
1201 int tmp = ones % 10;
1202 if (tmp)
1203 {
1204 talk_id(VOICE_ZERO + tmp, true);
1205 talk_id(VOICE_NUMERIC_TENS_SWAP_SEPARATOR, true);
1206 }
1207 }
1208 /* combination indexing */
1209 if (ones > 20)
1210 {
1211 int tens = ones/10 + 18;
1212 talk_id(VOICE_ZERO + tens, true);
1213 }
1197 } 1214 }
1215 else
1216 {
1217 /* combination indexing */
1218 if (ones > 20)
1219 {
1220 int tens = ones/10 + 18;
1221 talk_id(VOICE_ZERO + tens, true);
1222 ones %= 10;
1223 }
1198 1224
1199 /* direct indexing */ 1225 /* direct indexing */
1200 if (ones) 1226 if (ones)
1201 talk_id(VOICE_ZERO + ones, true); 1227 talk_id(VOICE_ZERO + ones, true);
1228 }
1202 1229
1203 /* add billion, million, thousand */ 1230 /* add billion, million, thousand */
1204 if (mil) 1231 if (mil)
@@ -1215,7 +1242,7 @@ int talk_number(long n, bool enqueue)
1215static int talk_year(long year, bool enqueue) 1242static int talk_year(long year, bool enqueue)
1216{ 1243{
1217 int rem; 1244 int rem;
1218 if(year < 1100 || year >=2000) 1245 if(year < 1100 || (year >=2000 && year < 2100))
1219 /* just say it as a regular number */ 1246 /* just say it as a regular number */
1220 return talk_number(year, enqueue); 1247 return talk_number(year, enqueue);
1221 /* Say century */ 1248 /* Say century */