# Maths problem

**URL:** <https://forum.kirupa.com/t/maths-problem/161085>\
**Category:** Uncategorized\
**Created:** [August 31, 2005, 7:58pm UTC](https://forum.kirupa.com/t/maths-problem/161085 "2005-08-31T19:58:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ineedsleep](https://avatars.discourse-cdn.com/v4/letter/i/e5b9ba/32.png) [@Ineedsleep](https://forum.kirupa.com/u/Ineedsleep)\
**Post date:** [August 31, 2005, 7:58pm UTC](https://forum.kirupa.com/t/maths-problem/161085/1 "2005-08-31T19:58:23Z")

</div>

can some one explain why its so hard just to set a number to 2 decimal places and also make ing a datefield work properly where youset a start date and an end date and work out how many days went between?

but could some one please look at this code and just show me how turn a whole number to a decimal its going to be used for currency!!!

many many thanks in advance

onClipEvent (enterFrame) {  
// no of days  
var dayVal;  
dayVal = \_root.day.value;  
dayVal = Math.ceil(dayVal/7);  
// rounds number up to 7  
trace(dayVal);  
//store size data  
var store;  
store = \_root.storesize.selectedItem.data;  
trace(store);  
//packing option 1  
var packing;  
packing = \_root.pack.selectedItem.data;  
trace(packing);  
//extras pricing  
var absorpolePrice;  
absorpolePrice = 25.00;  
var dustPrice;  
dustPrice = 9.50;  
var lightPrice;  
lightPrice = 15.00;  
var truckPrice;  
truckPrice = 25.00;  
// extras variables  
var absorpole;  
absorpole = \_root.options.abQty_absorpolePrice;  
trace("a: "+absorpole);  
var dust;  
dust = \_root.options.dustQty_dustPrice;  
trace("b: "+dust);  
var truck;  
truck = \_root.options.truckQty_truckPrice;  
trace("c: "+truck);  
var light;  
light = \_root.options.lightQty_lightPrice;  
trace("d: "+light);

var extrasTotal;  
extrasTotal = light + truck + dust + absorpole;  
var cost;  
cost = dayVal \* store;  
var totalCost;  
totalCost = cost + extrasTotal;

trace("total: "+totalCost);  
\_root.total.text= totalCost;

// decimal places???  
//\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
totalCost = totalCost / 44;  
trace(totalCost);  
totalCost = Math.round(totalCost);  
totalCost = totalCost \* 44;  
trace(totalCost);

}
