public
Description: Converts numbers, currency and other units to Polish, English, German
Homepage: http://trix.pl
Clone URL: git://github.com/tomaszmazur/verbal.git
Click here to lend your support to: verbal and make a donation at www.pledgie.com !
support for German
Tomasz Mazur (author)
Thu Sep 04 08:07:37 -0700 2008
commit  37a2868ebb94db9eccf6fa0b3fefa8f9d12143b4
tree    d8d9aa641cb03f203e88b316a084a245791548e7
parent  2ad0f1bbd5b0ff1290992b5c79aaa13dfd780b13
...
 
 
 
 
1
2
3
4
...
1
2
3
4
5
6
7
8
0
@@ -1,3 +1,7 @@
0
+=== 1.1.0 / 2008-09-04
0
+
0
+German support / Thanks to Soleone!
0
+
0
 === 1.0.0 / 2008-08-01
0
 
0
 Verbal is now a gem!
0
\ No newline at end of file
...
1
2
3
 
4
5
6
 
 
 
 
7
8
9
10
11
 
 
 
 
12
13
14
...
1
2
 
3
4
5
 
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
0
@@ -1,14 +1,21 @@
0
 module Verbal
0
   
0
- VERSION = '1.0.0'
0
+ VERSION = '1.1.0'
0
 
0
   module Core
0
-
0
+
0
+ # returns exponent of value in cubic interval
0
+ # 0 for 0-999, 3 for 1000-999999, 6 for 1_000_000-999_999_999 and so on ...
0
+
0
     def exponent(value)
0
       ((value.to_s.length - 1) / 3) * 3
0
     end
0
 
0
 
0
+ # returns array of pairs (exponent and corresponding value), so number can be easily converted to words
0
+ # 1_512_999 => [[6, 1], [3, 512], [0,999]]
0
+
0
+
0
     def process_thousands(value)
0
       e = exponent(value)
0
       readable_slices = []

Comments

    No one has commented yet.