I was trying to think an algorithm for naming an array. For example, it will have 1000 items. The names will be 0000, 0001, 0002 etc.
Which is better - the names to be strings or integers?
If int => how can I add the zeros in front?
If strings => wouldn't it be too complicated to find the last digit - increment it, and if it's 9 go to the previous digit. And it's a lot of parsing.
Which do you think is better?
Use integers, but when you display things, convert it to a string and add the leading zeros.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With