Zero Fill Numeric Field w/Decimal
Zero Fill Numeric Field w/Decimal
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
-
- Posts: 9
- Joined: Tue Oct 10, 2017 12:44 pm
=> RE: Zero Fill Numeric
create field with calculation below where numer is the field name____iif(numer<0,"-","0") right("00000000000" ltrim(str(abs(numer),11,2)),11)
-
- Posts: 9
- Joined: Tue Oct 10, 2017 12:44 pm
=> RE: Zero Fill Numeric Field w/D
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
This is ridiculous, ____replace fielda with iif(numer<0,"-","0" ) + right("00000000000"+ltrim(str(abs(numer),11,2)),11) all
-
- Posts: 9
- Joined: Tue Oct 10, 2017 12:44 pm
==> RE: Zero Fill Numeric Field w/D
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