VP-ASP :: Shopping Cart Software

Shopping Cart Software Solutions for anywhere in the World

US/Canada(Toll Free): +1 888 587 2278
Europe/UK: +44 (020) 7193 9408
Australia/New Zealand: +61 3 9016 4497

VP-ASP Shopping Cart Customer Forum

Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VPCart Forum
 Customization
 Show Prices with leading 0
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

poldy
Starting Member

25 Posts

Posted - September 24 2012 :  08:09:05  Show Profile  Reply with Quote
We are selling low price products and need to show our prices with leading 0.
$ 0.95 looks better then $.95.

How do we do this.

Thanks

devshb
Senior Member

United Kingdom
1898 Posts

Posted - September 24 2012 :  17:42:53  Show Profile  Visit devshb's Homepage  Reply with Quote
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
Go to Top of Page

poldy
Starting Member

25 Posts

Posted - September 25 2012 :  01:48:11  Show Profile  Reply with Quote
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
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000