From: <pra...@us...> - 2007-11-17 12:45:18
|
Revision: 1263 http://oorexx.svn.sourceforge.net/oorexx/?rev=1263&view=rev Author: pragmatic_lee Date: 2007-11-17 04:45:18 -0800 (Sat, 17 Nov 2007) Log Message: ----------- Modified Paths: -------------- incubator/decimalFormat/decimalFormat.cls incubator/decimalFormat/df.txt incubator/decimalFormat/test_decimalformatter.rex Modified: incubator/decimalFormat/decimalFormat.cls =================================================================== --- incubator/decimalFormat/decimalFormat.cls 2007-11-16 23:55:07 UTC (rev 1262) +++ incubator/decimalFormat/decimalFormat.cls 2007-11-17 12:45:18 UTC (rev 1263) @@ -48,6 +48,9 @@ Added ability to retrieve grouping setting for either positive, negative, or both patterns Added ability to set grouping for either positive, negative, or both patterns + Changed the way numeric digits is set from an arbitrary value of 30 + to a computed value based on the length of the input + the number of decimal places + specified in the pattern. */ -- get the grouping for the specified pattern @@ -516,7 +519,8 @@ ph0 = dec_p~countStr('0') if ph0 > adder then adder = ph0 - numeric digits input~length + adder + if input~length + adder > 9 then + numeric digits input~length + adder if \input~datatype('n') then raise syntax 93.904 array(1,arg(1)) @@ -576,7 +580,8 @@ ph0 = dec_p~countStr('0') if ph0 > adder then adder = ph0 - numeric digits input~length + adder + if input~length + adder > 9 then + numeric digits input~length + adder parse var mask2use m_part1'.'m_part2 -- format input based on the length of the decimal portion of the mask Modified: incubator/decimalFormat/df.txt =================================================================== --- incubator/decimalFormat/df.txt 2007-11-16 23:55:07 UTC (rev 1262) +++ incubator/decimalFormat/df.txt 2007-11-17 12:45:18 UTC (rev 1263) @@ -1,48 +1,48 @@ -20071116 - 17:34:42 +20071117 - 07:44:29 decimalFormat Version..: Beta .2 Full -"$"#,##0.00;"-$"####.##;"[0]" +#,###.## pPattern -#,##0.00 -#,##0.00 +#,###.## +#,###.## 0,000.00 pPrefix -$ -$ + + CD -"CD "0,000.00;"-$"####.##;[0] +"CD "0,000.00;"-"#,###.## pSuffix -><- -><- -> CR<- -"CD "0,000.00" CR";"-$"####.##;[0] +"CD "0,000.00" CR";"-"#,###.## nPattern -####.## -####.## +#,###.## +#,###.## #,##0.00 nPrefix --$ --$ +- +- -CD( -"CD "0,000.00" CR";"-CD("#,##0.00" CR";[0] +"CD "0,000.00" CR";"-CD("#,##0.00" CR" nSuffix -> CR<- -> CR<- ->)<- -"CD "0,000.00" CR";"-CD("#,##0.00")";[0] +"CD "0,000.00" CR";"-CD("#,##0.00")" zPattern -[0] -[0] -->The NIL object<- -"CD "0,000.00" CR";"-CD("#,##0.00")";The NIL object +0,000.00 +0,000.00 +->0,000.00<- +"CD "0,000.00" CR";"-CD("#,##0.00")" 1 Pattern Is ->('#,###.##')<->Grouping Size Is -> 3 <- UnFormatted Formatted Test # Modified: incubator/decimalFormat/test_decimalformatter.rex =================================================================== --- incubator/decimalFormat/test_decimalformatter.rex 2007-11-16 23:55:07 UTC (rev 1262) +++ incubator/decimalFormat/test_decimalformatter.rex 2007-11-17 12:45:18 UTC (rev 1263) @@ -49,9 +49,6 @@ ostream~lineout(' ') end - - f = .decimalFormat~new('"$"#,##0.00;"-$"####.##;"[0]"') - dline = 'Full' ; call Logit dline = f~Pattern ; call Logit dline = '' ; call Logit This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |