Quantcast
Channel: Adobe Community : Popular Discussions - JavaScript
Viewing all articles
Browse latest Browse all 12130

Creating a custom calculation script limited to two decimals

$
0
0

This question is really broader than the title. Here's what I'm trying to accomplish for an order form:

 

Line 1: Number of products ordered (A).

User indicates how many products he wishes to order. The total number of products ordered adds up to A.

 

Line 2: Product Cost (C).

A * 4.95 (which is the cost per unit) is the product cost (C). I want C to be two decimals after the decimal point, so if four units are ordered, the cost is $19.80, not 19.8 (or 19.8000000000001)

 

Line 3: Shipping (S).

If they order one unit, the shipping cost is $2.50

If they order 2-5 units, the shipping cost is $5

If they order 6-15 units, the shipping cost is $10

 

Line 4: Overall cost.

C + S

 

Can anyone tell me how to accomplish this? And how do I learn how to do this on my own?

 

Acrobat 9.4.6, Macintosh


Viewing all articles
Browse latest Browse all 12130

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>