Photo Gallery
Member List
Search
Calendars
FAQ
Ticket List
Log Out
Forums
Register
Login
My Profile
Inbox
Address Book
My Subscription
My Forums
curreceny in vbscript
Logged in as: Guest
arrSession:exec spGetSession 2,2,53829
Active Users: There are
0
members and
0
guests.
Users viewing this topic: none
Printable Version
All Forums
>>
[Scripting]
>>
WSH & Client Side VBScript
>> curreceny in vbscript
Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page:
[1]
Login
Message
<< Older Topic
Newer Topic >>
curreceny in vbscript -
11/26/2007 9:02:17 PM
acerf1
Posts: 1
Score: 0
Joined: 11/26/2007
Status:
offline
hiya all im new to vb script i have been following a tut on the internet , i need help on how to change the currency to £ in the following bit of code
many thanks
FOR x = 0 TO UBOUND( localCart, 2 ) IF localCart( CARTPID, x ) <> "" THEN orderTotal = orderTotal + ( localCart( CARTPPRICE, x ) * localCart( CARTPQUANTITY, x ) ) DIM chId,chProduct,chPrice,chQuantity chId=(localCart( CARTPID, x) ) chProduct=Server.HTMLEncode( localCart( CARTPNAME, x ) ) chPrice=formatCurrency( localCart( CARTPPRICE, x ) ) <% 'THE NEXT BIT PRINTS THE CONTENTS OF THE CART TO THE TEXT BOX %> <%="ID#: " & chId & vbcrlf & "Product: " & chProduct & vbcrlf &"Unit Price: " & chPrice & vbcrlf &"Quatity: " & chQuantity & "Item" & vbcrlf & "_________" & vbcrlf%> <% END IF
thank for u any help
Post #: 1
RE: curreceny in vbscript -
11/26/2007 10:56:14 PM
ehvbs
Posts: 2200
Score: 50
Joined: 6/22/2005
From: Germany
Status:
offline
Hi acerfi,
use Locale:
Dim dblVal : dblVal = 1234.5678 Dim cryVal : cryVal = CCur( 1234.5678 ) Dim oldLocale WScript.Echo GetLocale(), "dblVal:", dblVal WScript.Echo GetLocale(), "Preis:", FormatCurrency( cryVal ) oldLocale = SetLocale( "en-us" ) WScript.Echo GetLocale(), "Price:", FormatCurrency( cryVal ) SetLocale "en-gb" WScript.Echo GetLocale(), "Price:", FormatCurrency( cryVal ) SetLocale "fr-ca" WScript.Echo GetLocale(), "Price:", FormatCurrency( cryVal ) SetLocale "fr-fr" WScript.Echo GetLocale(), "Prix:", FormatCurrency( cryVal ) SetLocale "it" WScript.Echo GetLocale(), "Prezzo:", FormatCurrency( cryVal ) SetLocale oldLocale WScript.Echo GetLocale(), "Preis:", FormatCurrency( cryVal ) ------------ output -------------- === demoCurrency: demo Currency data type ==== === demoCurrency: demo Currency data type === 1031 dblVal: 1234,5678 1031 Preis: 1.234,57 DM 1033 Price: $1,234.57 2057 Price: £1,234.57 3084 Price: 1 234,57 $ 1036 Prix: 1 234,57 F 1040 Prezzo: L. 1.235 1031 Preis: 1.234,57 DM === demoCurrency: 0 done (00:00:00) =========
Good luck!
ehvbs
(in reply to
acerf1
)
Post #: 2
If you found our site useful please link to us
<a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>
.
All Forums
>>
[Scripting]
>>
WSH & Client Side VBScript
>> curreceny in vbscript
Page:
[1]
Jump to:
Select a Forum
All Forums
----------------------
[Welcome]
- - Forum Rules
- - Test Posting Messages
- - New Member Area/Introduction
[Scripting]
- - WSH & Client Side VBScript
- - WSH & Client Side VBScript Tutorial
- - Post a VBScript
- - Windows PowerShell
- - ASP
- - ASP.NET
- - Windows Script Components
[General Forum]
- - Other Programming/Scripting Languages
- - Suggestions & Feedback
- - Off-Topic Lounge
New Messages
No New Messages
Hot Topic w/ New Messages
Hot Topic w/o New Messages
Locked w/ New Messages
Locked w/o New Messages
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
Forum Software ©
ASPPlayground.NET
Advanced Edition
2.5.5 ANSI