aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-09-28 14:22:58 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-09-28 14:22:58 +0000
commit07ab0f8ff43b24bccf7b121b693f16fdfcf4977b (patch)
tree95c3a640815c02dd342bc2345864bd008e7ec3ac /main
parent3fdc6e41c7d59e472e3b80c98ce88f4cce6b9c7c (diff)
Merged revisions 84078 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r84078 | tilghman | 2007-09-28 09:13:47 -0500 (Fri, 28 Sep 2007) | 2 lines Correct pronunciations of numbers for .nl (Closes issue #10837) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@84079 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/say.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/main/say.c b/main/say.c
index 9f77d3466..6350dbce0 100644
--- a/main/say.c
+++ b/main/say.c
@@ -1603,21 +1603,35 @@ static int ast_say_number_full_nl(struct ast_channel *chan, int num, const char
snprintf(fn, sizeof(fn), "digits/%d", num - units);
num = 0;
}
+ } else if (num < 200) {
+ /* hundred, not one-hundred */
+ ast_copy_string(fn, "digits/hundred", sizeof(fn));
+ num -= ((num / 100) * 100);
+ } else if (num < 1000) {
+ snprintf(fn, sizeof(fn), "digits/%d", num / 100);
+ playh++;
+ num -= ((num / 100) * 100);
} else {
- if (num < 1000) {
- snprintf(fn, sizeof(fn), "digits/%d", (num/100));
- playh++;
- num -= ((num / 100) * 100);
+ if (num < 1100) {
+ /* thousand, not one-thousand */
+ num = num % 1000;
+ ast_copy_string(fn, "digits/thousand", sizeof(fn));
+ } else if (num < 10000) { /* 1,100 to 9,9999 */
+ res = ast_say_number_full_nl(chan, num / 100, ints, language, audiofd, ctrlfd);
+ if (res)
+ return res;
+ num = num % 100;
+ ast_copy_string(fn, "digits/hundred", sizeof(fn));
} else {
if (num < 1000000) { /* 1,000,000 */
- res = ast_say_number_full_en(chan, num / 1000, ints, language, audiofd, ctrlfd);
+ res = ast_say_number_full_nl(chan, num / 1000, ints, language, audiofd, ctrlfd);
if (res)
return res;
num = num % 1000;
snprintf(fn, sizeof(fn), "digits/thousand");
} else {
if (num < 1000000000) { /* 1,000,000,000 */
- res = ast_say_number_full_en(chan, num / 1000000, ints, language, audiofd, ctrlfd);
+ res = ast_say_number_full_nl(chan, num / 1000000, ints, language, audiofd, ctrlfd);
if (res)
return res;
num = num % 1000000;