[thelist] Calculations in JS

Adrian Fischer adrian at aussiebidder.com
Sun Jul 21 05:27:00 CDT 2002


Greetings One and All,

In JS I'm doing some calculations and I need to shorten the result down to 2
decimals.  The number I am multiplying by is 0.00833333333333 ( could round
up to 0.834)  but I don't want to display a gazillion places.  In perl I
know how to shorten the displayed figure but not in JS.  Can someone help
please.

That was the easy bit.  That calculation is happening continuously in the
background.  Its actually the number of seconds the window has been opened
multiplied by the figure above.  When the user exits the window (closes it
with close button or by Xing the window) can I save the updated variable to
a cookie?

When the user opens the window again, can I then get the number of seconds
difference between the saved variable in the cookie and the current time, do
the multiplication and then continue on from there?

Would it also be possible to have the JS interact with a perl script on my
server to update a counter.  It would be nice to know how many instances of
this window get passed around.

Have I been to vague here?

Regards

Adrian Fischer
http://aussiebidder.com





More information about the thelist mailing list