/    Sign up×
Community /Pin to ProfileBookmark

Problem in my computation result Infinity

Hi..

I have this function:

[code]
function doz(oText){
var P27_max = document.getElementById(“P27_max”).value;
//var P27_max_convert = parseFloat(P27_max) + parseFloat(1);
var P27_max_convert = ((parseFloat(P27_max) * parseFloat(1000)) / parseFloat(0.00) / parseFloat(12));
if( !isNaN(P27_max_convert) ){
var P27_maxdoz = document.getElementById(“P27_maxdoz”).value = P27_max_convert.toFixed(2);
}

var P28_max = document.getElementById(“P28_max”).value;
// var P28_max_convert = parseFloat(P28_max) + parseFloat(2);
var P28_max_convert = ((parseFloat(P28_max) * parseFloat(1000)) / parseFloat(22.00) / parseFloat(12));
if( !isNaN(P28_max_convert) ){
var P28_maxdoz = document.getElementById(“P28_maxdoz”).value = P28_max_convert.toFixed(2);
}
}
[/code]

my output is Infinity..

what’s wrong in my computation :

var P28_max_convert = ((parseFloat(P28_max) * parseFloat(1000)) / parseFloat(22.00) / parseFloat(12));

Thank you

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@007JulienMar 12.2012 — It's wrong to divide by 0, like in this third line of the function !
[CODE]var P27_max_convert = ((parseFloat(P27_max) * parseFloat(1000))[COLOR="Red"] / parseFloat(0.00) [/COLOR]/ parseFloat(12)); [/CODE]
Copy linkTweet thisAlerts:
@newphpcoderauthorMar 12.2012 — Thank you...
×

Success!

Help @newphpcoder 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 5.20,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...