/    Sign up×
Community /Pin to ProfileBookmark

I need help with a javascript function for dynamic prices!!!

I am trying to find a function that will allow me to take an equation, and post the output in another location. For example.

x * y + z = output

I need to get the output to display in a certain section of the website. Anybody know a java script function that will do what I need???

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@JMRKERJul 08.2009 — See the following for examples on how to combine

the eval() function with variables or formulas to do what you want.

http://www.webdeveloper.com/forum/showthread.php?t=199346&highlight=eval+calculation

http://www.webdeveloper.com/forum/showthread.php?t=106841&highlight=eval+calculation

Personally, I would not want users entering the formulas because

it would be too easy for them to make a mistake and cause the script

to fail without much explanation.
×

Success!

Help @Sarcastr0 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.17,
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,
)...