net-workx
asked on
Format Variable As 2 Decimal Places - URGENT 500 Points
Hello i have this code..
<% Response.Write strCurrencySymbol %>
<% intVatAmount = ((intSubTotal/100) * strVatRate) %>
<% IF intVatAmount = 0 THEN Response.Write "0.00" ELSE Response.Write intVatAmount %>
and would like to know how to response.write intVatAmount as 2 decimal places (as in a currency)
Regards,
Carl
<% Response.Write strCurrencySymbol %>
<% intVatAmount = ((intSubTotal/100) * strVatRate) %>
<% IF intVatAmount = 0 THEN Response.Write "0.00" ELSE Response.Write intVatAmount %>
and would like to know how to response.write intVatAmount as 2 decimal places (as in a currency)
Regards,
Carl
response.write(formatCurre ncy(intVat Amount))
hello, sorry i didn't say hi, here's your new code:
<% Response.Write strCurrencySymbol %>
<% intVatAmount = ((intSubTotal/100) * strVatRate) %>
<% IF intVatAmount = 0 THEN Response.Write "0.00" ELSE Response.Write formatCurrency(intVatAmoun t )%>
<% Response.Write strCurrencySymbol %>
<% intVatAmount = ((intSubTotal/100) * strVatRate) %>
<% IF intVatAmount = 0 THEN Response.Write "0.00" ELSE Response.Write formatCurrency(intVatAmoun
ASKER
This is not what i want to do as the format currency uses the servers local variable - i want this system to be currenty independant from the server.
the Response.Write strCurrencySymbol comes from a personalisation table which has VAT rates, currency symbols, currency types for integration into the payment processing gateway.
I just need to know how to format the figure as 13.65 rather than 13.65665454 for example.
Regards,
Carl
the Response.Write strCurrencySymbol comes from a personalisation table which has VAT rates, currency symbols, currency types for integration into the payment processing gateway.
I just need to know how to format the figure as 13.65 rather than 13.65665454 for example.
Regards,
Carl
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
the 2 in the formatNumber represents how many numbers after the decimal you want to show.
ASKER
Thanks for your help - worked perfectly!!
Regards,
Carl
Regards,
Carl
glad to help!