diff options
author | Tilghman Lesher <tilghman@meg.abyt.es> | 2007-09-28 14:22:58 +0000 |
---|---|---|
committer | Tilghman Lesher <tilghman@meg.abyt.es> | 2007-09-28 14:22:58 +0000 |
commit | 8b2b13a750d15b019c437d0dc827fe09f61bd43a (patch) | |
tree | 95c3a640815c02dd342bc2345864bd008e7ec3ac /main/say.c | |
parent | d3904a21c4b8c21c510ec645db87488ca1d54387 (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: https://origsvn.digium.com/svn/asterisk/trunk@84079 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/say.c')
-rw-r--r-- | main/say.c | 26 |
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; |