x# transform() and SetCentury() issues
Posted: Sun Aug 12, 2018 4:28 pm
Guys,
1. I´ve noticed that transform() adds unnecessary thousands separators
2. SetCentury() does not alter the year part of the date template.
Note: a german windows is used.
SetCentury() should change the date template automatically, similar as SetDateFormat() automatically changes the SetCentury() setting.
regards
Karl-Heinz
1. I´ve noticed that transform() adds unnecessary thousands separators
Code: Select all
?
? "SetThousandsep() " + chr ( SetThousandsep () ) // "." ok
? "SetDecimalsep() " + chr ( SetDecimalsep () ) // "," ok
? transform ( 2.45 , "@R 999,999.99" ) // " . 2,45"
? transform ( -2.45 , "@R 999,999.99" ) // " . -2,45"
? transform ( 24.58 , "@R 999,999.99" ) // " . 24,58"
? transform ( -24.58 , "@R 999,999.99" ) // " .-24,58"
? transform ( 245.78 , "@R 999,999.99" ) // " .245,78"
? transform ( -245.78 , "@R 999,999.99" ) // " -.245,78" <----
? transform ( 1245.78 , "@R 999,999.99" ) // " 1.245,78" ok
? transform (-1245.78 , "@R 999,999.99" ) // " -1.245,78" ok
? transform ( 1245.78 , "@R 999,999,999.99" ) // " . 1.245,78"
? transform (-1245.78 , "@R 999,999,999.99" ) // " . -1.245,78"
? transform ( 245.78 , "@R 999,999,999.99" ) // " . .245,78"
? transform ( 551245.78 , "@R 999,999,999.99" ) // " .551.245,78"
// without thousand sep
? transform ( 24.58 , "@R 999999.99" ) // " 24,58" ok
? transform ( -24.58 , "@R 999999.99" ) // " -24,58" ok
? transform ( -234.45 , "@R 999999.99" ) // " -234,45" ok
? transform ( 234.45 , "@R 999999.99" ) // " 234,45" ok
? transform ( -1234.45 , "@R 999999.99" ) // " -1234,45" ok
? transform ( 1234.45 , "@R 999999.99" ) // " 1234,45" ok
?
// problem with none floats
? transform ( -124 , "@R 999,999.99" ) // " . -,24"
? transform ( 124 , "@R 999,999.99" ) // " . ,24"
// without thousand sep
? transform ( -124 , "@R 999999.99" ) // " -,24"
? transform ( 124 , "@R 999999.99" ) // " ,24"
? transform ( -124 , "999999.99" ) // " -,24"
? transform ( 124 , "999999.99" ) // " ,24"
2. SetCentury() does not alter the year part of the date template.
Note: a german windows is used.
Code: Select all
LOCAL d AS DATE
d := condate ( 2018 , 8 , 12 )
// The default Setcentury() setting is false - VOs default is true
? Setcentury() // false
// but the 4 digits year format is active
? GetDateFormat() // DD.MM.YYYY
? d // 12.08.2018
?
SetCentury( FALSE )
// Setcentury() doesn´t change the date template.
// the 4 digits year format is still active.
? SetCentury()
? GetDateFormat() // DD.MM.YYYY
? d // 12.08.2018
?
SetCentury(TRUE)
?
// force a 2 digits year display
// note: SetDateFormat() changes the SetCentury() setting automatically
SetDateFormat ( "DD.MM.YY" )
? Setcentury() // ok, shows false now
? GetDateFormat() // ok DD.MM.YY
? d // ok 12.08.18
?
// force a 4 digits year display
// note: SetDateFormat() changes the SetCentury() setting automatically
SetDateFormat ( "DD.MM.YYYY" )
? Setcentury() // ok, shows true now
? GetDateFormat() // ok DD.MM.YYYY
? d // ok 12.08.2018
?
SetCentury() should change the date template automatically, similar as SetDateFormat() automatically changes the SetCentury() setting.
regards
Karl-Heinz