Need help with sum.toFixed(2)
Hello everyone,
I am having trouble finding an answer to my problem. I am currently using a calculator plug-in script provided by Pengoworks.com. Everything is works very well.
Howerver what I am trying to do is display the the sum within an input field instead of a "div".
Here is the last bit of code:
- // define the finish callback, this runs after the calculation has been complete
function ($this){
// sum the total of the $("[id^=total_item]") selector
var sum = $this.sum();
$("#grandTotal").text(
"$" + sum.toFixed(2)
);
}
Instead of displaying in "<div id="grandTotal"></div>, I am trying to get it to display in "<input type="text" name="grandTotal" id="grandTotal" value="" size="2" />".
Any suggestions/thoughts?
Thanks everyone!