Which of the storage objects can store numbers that have decimal points?
Thanks,
Steve
Printable View
Which of the storage objects can store numbers that have decimal points?
Thanks,
Steve
Hmmm... looks like neither Array or Dynamic Array can do this.
What are you planning to use the decimal numbers for? Often times, it is actually easier (not to mention more efficient) to store decimal value as, say, an integer that is 100 times more than the decimal. Then when you want to retrieve it later, just divide by 100.0 and you have your decimal number.
Why not store it as a string?
You could just use a counter or you could simply store your float as a string. When you go to return it to a value just covert it to a value. I've tried a few object and it seems to work ok.
I'm making science applications that require a lot of numerical data to be stored. It just seems odd to me that a number storage object would not take a number unless it is an integer. You can store the numbers as strings, but that means converting them which adds an extra step each time. And dividing by 100 or 1000 doesn't work too well when the numbers can range from 0.0005 to 100,000,000. Creating any science or accounting applications really needs a way to store decimal numbers more conveniently.
Steve