Page 1 of 1

Zero Fill Numeric Field w/Decimal

Posted: Fri Nov 02, 2001 2:38 pm
by jaem
I need to zero fill a 12 character numeric fixed field with a decimal(000000079.17 EXAMPLE) May contain negative amounts like(-00000079.17 EXAMPLE) ____HELP!!!!!!!!!!__ __Jae Markham__Programmer/Analyst__College of the Sequoias__Visalia, CA 93277

=> RE: Zero Fill Numeric

Posted: Fri Nov 02, 2001 3:40 pm
by John_McDonald_(Guest)
create field with calculation below where numer is the field name____iif(numer<0,"-","0") right("00000000000" ltrim(str(abs(numer),11,2)),11)

=> RE: Zero Fill Numeric Field w/D

Posted: Fri Nov 02, 2001 3:44 pm
by John_McDonald_(Guest)
Sorry about that, the last post converted my formula to smileys____replace fielda with iif(numer<0,"-","0") right("00000000000" ltrim(str(abs(numer),11,2)),11) all

=> Zero Fill Numeric Field w/Decimal

Posted: Fri Nov 02, 2001 3:48 pm
by kfleming
This is ridiculous, ____replace fielda with iif(numer<0,"-","0" ) + right("00000000000"+ltrim(str(abs(numer),11,2)),11) all

==> RE: Zero Fill Numeric Field w/D

Posted: Fri Nov 02, 2001 3:48 pm
by John_McDonald_(Guest)
A calculated field with expression:____IIF(num<0,__"-" replicate("0",11-len(ltrim(str(abs(num),12,2))))-ltrim(str(abs(num),12,2))__,__replicate("0",12-len(ltrim(str(abs(num),12,2))))-ltrim(str(abs(num),12,2)))____might be one way to get there.____Kathleen__R&R Support