Re: String manipulations
- From: "Philippe C. Martin" <philippe@xxxxxxxxxxxxxxxxxxx>
- Date: Sat, 28 May 2005 21:43:08 GMT
Multiply them by 10000 ?
Lorn wrote:
> I'm trying to work on a dataset that has it's primary numbers saved as
> floats in string format. I'd like to work with them as integers with an
> implied decimal to the hundredth. The problem is that the current
> precision is variable. For instance, some numbers have 4 decimal places
> while others have 2, etc. (10.7435 vs 1074.35)... all numbers are of
> fixed length.
>
> I have some ideas of how to do this, but I'm wondering if there's a
> better way. My current way is to brute force search where the decimal
> is by slicing and then cutoff the extraneous numbers, however, it would
> be nice to stay away from a bunch of if then's.
>
> Does anyone have any ideas on how to do this more efficiently?
>
> Many Thanks,
> Lorn
.
- Follow-Ups:
- Re: String manipulations
- From: Lorn
- Re: String manipulations
- References:
- String manipulations
- From: Lorn
- String manipulations
- Prev by Date: Re: Getting value of radiobutton trouble
- Next by Date: Re: String manipulations
- Previous by thread: String manipulations
- Next by thread: Re: String manipulations
- Index(es):