comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » floats from strings... duh!
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Floats [message #47966 is a reply to message #47851] Thu, 09 March 2006 15:16 Go to previous messageGo to previous message
Andrew Cool is currently offline  Andrew Cool
Messages: 219
Registered: January 1996
Senior Member
Paul Van Delst wrote:
> Mark Hadfield wrote:
>> Paul Van Delst wrote:
>>
>>> Sheldon wrote:
>>>
>>>>
>>>> Here is a silly question: Can I define a float array and control how
>>>> many decimal places are kept? For example, I want all values to only
>>>> have an accuracy to the nearest 100th (20.15 and not 20.154983445).
>>>> Kind of like in printing, you know, the f5.2 print definition, but only
>>>> for variables and arrrays.
>>>
>>>
>>> May I ask why? Usually this sort of thing is required for printing,
>>> but not for regular old storage of numbers.
>>
>>
>> Currency?
>
> Ah, fair enough. But a hasty google reveals that currency calculations are not done at the
> cent level - a higher precision is required; for currency conversions (6sigfigs), or in
> calculating how much you have to pay when you buy petrol or gas etc, (1000th's seem to be
> the common unit.).
>
> Another example I looked at converted 1000 Finnish Markka's to Euros 6 times (conversion
> rate to 6sigfig) and added the result (€1024.92). Converting 6000 Finnish Markka's was
> €1024.90 A 2 cent difference. That may add up when you're converting lotsa moola lotsa times.
>
> So, it seems to me the only reason you'd need precision to 100th's for currency is for
> printing your invoices. :o)
>
> cheers,
>
> paulv
>

When I were young'un just out of Uni, I worked in the local HQ of
British Petroleum (BP),
and the one number we all learned by heart was the conversion factor
from imperial
gallons to metric litres : 4.54609 litres/imp_gallon. A road going
petrol tanker in those
days held 37,000 litres, and a big service station might get 2 or 3 of
those delivered
per day. Even the temperature of the petrol (gas for the Yanks) was
taken into account
in determining the volume delivered. Of course 37,000L ain't all that
much compared to
the mega-millions held in the big storage tanks, where 4.54609 really
made a difference.

I had the opportunity once to walk on top of one of the big storage
tanks. Round and round up the spiral stairs running around the outside
oft he tank, then onto the roof.
The roof was made of thin metal, and designed to blow off in event of
fire. It flexed
like a trampoline as you walked on it, and it was the most uncanny, and
scariest
experience all at the same time. Would this thing support me, or dump
me into
the hydrocarbon bath below...? Once was enough!

Slightly OT, but Hey! It's Friday...

Andrew
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: matching 2 grids
Next Topic: Solaris 10

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 14:51:52 PDT 2025

Total time taken to generate the page: 6.48125 seconds