/    Sign up×
Community /Pin to ProfileBookmark

Problem Calculating in Forms with Cents

Hi,
I’ve been given a great code for calculating (price * quantity) and having it show up in the total field. The problem is that I decided to use it for another form that uses smaller prices using cents. These cents will show up in the (price * quantity) field but the cents get rounded “down” to the nearest dollar amount in the total field. Can anyone see what can be done to correct this code. I shall attach it as txt. Thank you for any suggestions.
Craig

[upl-file uuid=d7a2a0c5-9dd9-4b9c-b153-bd8b8e23579a size=10kB]GrandmaFolleysPantry_OrderForm.txt[/upl-file]

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@vwphillipsJul 02.2005 — check to see if parseInt is being used to convert strings to digits

if so change parseInt to parseFloat
Copy linkTweet thisAlerts:
@Craig52authorJul 04.2005 — That did it Vic, thank you very much.

Craig
×

Success!

Help @Craig52 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.16,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

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