how do i reduce a string length without losing meaning
Posted: Mon Jan 08, 2007 4:55 am
hi
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.
thanks
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.
thanks