
Zero Filling Number and removing decimal
Data Kruncher May 15, 2014 10:02 AM (in response to kstorey _)Hi Kevin,
You're right: you'll need a calculated field to accomplish this, and here's the formula you can copy and paste into the expression box:
[SIZE=2]if(Amount=0,"",right("0000000"+trim(str((Amount*100))),7))[/SIZE][/code]
This will give you a blank if Amount is zero, and leading zeros if it's not. I assume that you're not expecting negative values in the Amount field.
HTH,
Kruncher

Zero Filling Number and removing decimal
kstorey _ May 15, 2014 10:02 AM (in response to Data Kruncher)Kruncher,
I tried pasting the formula into the expression box as you suggest and I got an "Operand types" error. I did verify that the field and the source data was a number field. Any suggestions?
Thanks,
Kevin

Zero Filling Number and removing decimal
kstorey _ May 15, 2014 10:02 AM (in response to kstorey _)Kruncher,
I changed the type to a character and it worked. I will see if that will work for the file. I guess it has to.
Thanks for your help,
Kevin

Zero Filling Number and removing decimal
Data Kruncher May 15, 2014 10:02 AM (in response to kstorey _)Correct. I should have specified that you need a Character type field for leading zeros. Sorry about the oversight.

Zero Filling Number and removing decimal
Diane Miller May 15, 2014 10:02 AM (in response to Data Kruncher)This worked perfect. I had the exact same question. Thanks everyone.



