Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1887
  • Last Modified:

format currency

how to set the money currency without the dollar sign($) beside it, the asp command 'formatcurrency(number)' will have the dollar sign attach with the number.
Is it need to code this function buy ourself?
Thanks..
0
lico
Asked:
lico
1 Solution
 
AlfaNoMoreCommented:
FormatNumber will give you what you want?

If you want a different currency next to the number, you can set the LocaleID for the locale you want.

LCID=2057   GBP/UK
0
 
gladxmlCommented:
lico,

Instead of formatcurrency you can use the round function...

Check the link below for more details...

http://www.intranetsplus.com/Industry/dev/vbscript/round.html

HTH...


0
 
gladxmlCommented:
lico,

Using round function will not work directly as fromat currency you still need to manipulate the data...



0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
WakieCommented:
If you want to continue using your formatcurrency function, but without the dollar sign attached, you can remove it like this:

<%
intCurrency = "yourValueHere"
response.write right(intCurrency, len(intCurrency) - 1)
%>

Regards,
Wakie.
0
 
AlfaNoMoreCommented:
Slow down boys. FormatCurrency without the curreny symbol == FormatNumber! Simple.

You want a different currency symbol instead of the Default US dollar sign, well then set the LocaleID, eith at the top of the page, or even within the session:

<%@ Language="VBScript" LCID="2057" %>

<% Session.LCID = 2057 %>
0
 
memerotCommented:
As alfanomore says, format number will work.  But I think the following snippet is a little clearer as to your intent:

Replace(FormatCurrency(curAmount), "$", "")

Since it clearly shows that you are treating the value as money and just hiding the dollar sign.  It also clearly shows that you are hiding a dollar sign, showing the right X most characters does the same thing but is a bit more obscure to read.
0
 
GaryCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept Answer by AlfaNoMore

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
GaryC123
EE Cleanup Volunteer
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now