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've removed parseInt from var brand and var investor and this looks
like it *may* have solved the problem (var investor was also dropping
to a single digit too)


On Mon, 22 Mar 2021 at 09:32, Darren Cook <darren@example.com> wrote:
>
> > 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