/    Sign up×
Community /Pin to ProfileBookmark

Help for parseFloat

Hi, everyone

Please, help me with this problem.

I call the function parseFloat with an string argument which is a number with 2 digits after the point. And sometimes the result is a number with many more symbols avter the point. Can you help me?

Thanks in advance.

Best Regards,
Loshite

P.S. Here goes the code in which I use the paresFloat function:

document.form.totalBillSum1.value = parseFloat(document.form.totalBillSum1.value) + parseFloat(field.sum);
document.form.totalBillSum2.value = parseFloat(document.form.totalBillSum1.value);
posField = eval(“document.form.Pos”+field.posId);
posField.value = parseFloat(posField.value) + parseFloat(field.sum);

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@fredmvDec 15.2003 — Welcome to the forums.

Do you have a link in which has an example of this code running or the code for the HTML form possibly?
×

Success!

Help @loshite spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.1,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...