PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
as part of an app i'm working on, a code is generated in the form number.number i.e. 5.9 (its not a decimal but a code), the problem is that this could be any 2 numbers for example 19972.198234, and this means the string length increases dramatically over time. What i'm looking for is a way that these numbers could be represented while still minimising the string length. The restriction is that what ever is done to them has to be reversable and the original 2 numbers retrieved.
Just wondered if anyone here had any suggestions/ideas on how i could do this, as i'm floundering a little
all suggestions welcome and i'll answer any questions you have that mind help understand the issue.
the app was written in a mixture of php4 and php5.
oh, the numbers can be encoded before they are put in the format x.y if that helps.
Floating point has precision errors when you get out to certain ranges which can cause your numbers to become inaccurate. Stick with strings or just don't keep them together.