lesterd Posted December 5, 2006 Posted December 5, 2006 How do I take a number field and make it add three other fields and ALWAYS be three a three digit number. For example: if the field adds 10, 15, 15, the answer in the field would be "040" or if I add 2, 2, 3, the field would contain "007" Thanks for your help Lester
lesterd Posted December 5, 2006 Author Posted December 5, 2006 I found an answer, I think. Thanks Lester
Lee Smith Posted December 5, 2006 Posted December 5, 2006 Was it something like Right( "000" & (Field1 + Field2 + Field3); 3) HTH Lee
lesterd Posted December 5, 2006 Author Posted December 5, 2006 (edited) I found how to calculate a field to be the number I want. Calc is: Right("000" & Int(Big Total),3) &"." & Middle(Round(Big Total-Int(Big Total),2) & "0",2,1) Works great! BUT I loose this formating when I add the field to to another field in a new calculation Field A & Field B & Field C How do I keep the my calc from loosing the leading zeros in a new calculation? Thanks Lester Edited December 5, 2006 by Guest
Lee Smith Posted December 5, 2006 Posted December 5, 2006 I merged your two posts as they amounted to a Double Post. Please do not start a thread when asking followup questions, just reply to your original thread. As you can see, I posted a similar calculation that you used. I'll see if I can spot the problem. Lee
Lee Smith Posted December 5, 2006 Posted December 5, 2006 In order to pad the 0s in your total, the field has to be text field in v6. If you then use that field in another calculation, the calculation engine will strip out the leading zeros (and trailing zeros after the "." also). You migh try adjusting your final calculation so that the padded 0s are put into it (too) for the final result. HTH Lee
LaRetta Posted December 5, 2006 Posted December 5, 2006 Hi Lester, If you are adding numbers and wanting numeric results then why are you padding them with beginning zeros? As Lee says, numbers don't HAVE beginning zeros. You will continually struggle with this throughout your solution (converting all numbers using additional calculations); as you are realizing now. I can think of no reason that true numbers should be padded with leading zeros. LaRetta
Lee Smith Posted December 5, 2006 Posted December 5, 2006 Not to mention that the calculation will provide unexpected results if you have a number with a decimal in it. Lee
lesterd Posted December 5, 2006 Author Posted December 5, 2006 Thank you for all your help. It is working perfectly. Lester
Recommended Posts
This topic is 6624 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now