Hello,
I have written a script in Prototype version 1.6.0.2 and have written
the following function. I am currently unable to achieve the desired
British Pound Sterling (£) currency symbol as opposed to the United
States Dollar ($).
May I have any suggestions as to how I can achieve this? My code has
been supplied below:
sub_total: function() {
var In = this
return $$('.item').inject(0, function(sum, row) {
var quantity = Number($F('Item' + row.id + 'Quantity'))
var price = Number($F('Item' + row.id + 'Price'))
var line_total = quantity * price
$('Item' + row.id + 'Quantity').value = In.to_money(quantity)
$('Item' + row.id + 'Price').value = In.to_money(price)
$('Item' + row.id + 'Total').update('$' +
In.to_money(line_total))
return sum + line_total
})
},
tax: function() {
var tax_rate = Number($F('InvoiceTaxRate')) // passes in an item
var taxable_amount = this.sub_total()
tax_total = Math.round((tax_rate * 0.01 * taxable_amount) *
1000) / 1000
return Math.round(tax_total * 100) / 100
},
total: function() {
return this.sub_total() + this.tax()
},
refresh: function() {
$('subtotal').update('$' + this.to_money(this.sub_total()))
$('total').update('$' + this.to_money(this.total()))
$('tax').update('$' + this.to_money(this.tax()))
this.validate();
}
});
--
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en.