lost zero with add
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 2
- Joined: Thu Feb 07, 2019 4:22 pm
lost zero with add
I have some field with 00001. When i put it in variable all is fine. But when i make increment (add 1 e t c)zero in left part lost. Of course i can put count of zero in some variable and restore after increment. But maybe having better solution?
Re: lost zero with add
Hi margarinow,
welcome to the forum!
You need to tell LC to keep the trailing ZERO by setting "the numberformat" before doing the math:
Best
Klaus
P.S.
A little "Hello" or something is never a bad idea for the first posting.
welcome to the forum!
You need to tell LC to keep the trailing ZERO by setting "the numberformat" before doing the math:
Code: Select all
...
## Set to number of desired digits like this (5 digits, like in your example)
set numberformat to "xxxxx"
add 1 to fld "your field here"
...
Klaus
P.S.
A little "Hello" or something is never a bad idea for the first posting.
-
- Posts: 2
- Joined: Thu Feb 07, 2019 4:22 pm
Re: lost zero with add
Thanks for help, Klaus!
I'm new in Livecode sorry for simple mistake.
And of course hi for all.
I'm new in Livecode sorry for simple mistake.
And of course hi for all.
Re: lost zero with add
Hi.
What Klaus said.
But do read the dictionary entry for "numberFormat". It is important to know that many formatting issues require that at least one mathematical operation be run before the format will be applied.
Craig Newman
What Klaus said.
But do read the dictionary entry for "numberFormat". It is important to know that many formatting issues require that at least one mathematical operation be run before the format will be applied.
Craig Newman
Re: lost zero with add
Well knowing to set "the numberformat" is not really the most simple thing in LC! 
