Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] big number calculation to small number using javascript



> I want to take a user's numerical input and do a calculation on it to
> then show to the user on the screen the calculation as a smaller
> number (scientific notation)

This looks like a question more suitable for StackOverflow.

The Number.toExponential() function might be useful:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential

I think you are using jquery, embedded in a PHP script? I'd personally
start by trying reproduce the problem with a simpler script, replacing
form inputs with hard-coded values.

Darren


Home | Main Index | Thread Index