devshb
Senior Member
United Kingdom
1904 Posts |
Posted - September 24 2012 : 17:42:53
|
if using vpasp v7, edit shopproductsubs2.asp in notepad, and a few lines down from here:
function ShopFormatCurrency
you'll see this:
if GetSess("Newcurrencysymbol")<>"" then ShopFormatCurrency = GetSess("Newcurrencysymbol") & formatnumber (tamount, decimalpoint) elseif GetConfig("XCurrencySymbol") <> "" then ShopFormatCurrency = GetConfig("XCurrencySymbol") & formatnumber (tamount, decimalpoint) else ShopFormatCurrency = "$" & formatnumber (tamount, decimalpoint) end if
change the formatnumber lines to have an extra argument of -1 (which indicates to show leading zeroes on the pre-decimal amount), ie so it's like:
if GetSess("Newcurrencysymbol")<>"" then ShopFormatCurrency = GetSess("Newcurrencysymbol") & formatnumber (tamount, decimalpoint,-1) elseif GetConfig("XCurrencySymbol") <> "" then ShopFormatCurrency = GetConfig("XCurrencySymbol") & formatnumber (tamount, decimalpoint,-1) else ShopFormatCurrency = "$" & formatnumber (tamount, decimalpoint,-1) end if
Simon Barnaby Developer [email protected] www.BigYellowZone.com www.BigYellowKey.com Follow us on Twitter: http://twitter.com/bigyellowzone Web Design, Online Marketing and VPASP addons |
|
|
poldy
Starting Member
25 Posts |
Posted - September 25 2012 : 01:48:11
|
Thanks. I also added a space between currency symbol and number. This looks easier to read.
if GetSess("Newcurrencysymbol")<>"" then ShopFormatCurrency = GetSess("Newcurrencysymbol")&" " & formatnumber (tamount, decimalpoint,-1) elseif GetConfig("XCurrencySymbol") <> "" then ShopFormatCurrency = GetConfig("XCurrencySymbol")&" " & formatnumber (tamount, decimalpoint,-1) else ShopFormatCurrency = "$"&" "& formatnumber (tamount, decimalpoint,-1) end if |
|
|