kwilliams Posted May 12, 2006 Share Posted May 12, 2006 I'm new to this, so please bear with me. I'm trying to use the FormatCurrency Function to format a number located in a SQL Server 2k DB table. But I'm having a problem in defining the rules for the number. Basically, the number in the DB is "180792" (without quotes), and I want it transfered to "$1807.92". But my setup of this method is returning "$180,792".Here's more details on what I'm using, and what I'm trying to do:ORIGINAL DB VALUE:180792CURRENT CODE:Dim strNumber As String = Trim(rsQuery("Number").Value.ToString)strNumber = (FormatCurrency(strNumber,0))CURRENT RESULT:$180,792WANTED RESULT:$1,807.92I hope that someone can help me out with this one. I'm just not sure if this method has too many limitations that I can't use, or if I'm just not adding another few steps. Any and all help is appreciated. Thanks. Link to comment Share on other sites More sharing options...
pulpfiction Posted May 12, 2006 Share Posted May 12, 2006 I dont think you can do that with FormatCurrency Function. you can divide the number by 100 to get that. [you might be knowing this] about formatcurrencyhttp://www.csidata.com/custserv/onlinehelp...docs/vbs109.htm Link to comment Share on other sites More sharing options...
DimNull Posted September 18, 2006 Share Posted September 18, 2006 I'm new to this, so please bear with me. I'm trying to use the FormatCurrency Function to format a number located in a SQL Server 2k DB table. But I'm having a problem in defining the rules for the number. Basically, the number in the DB is "180792" (without quotes), and I want it transferred to "$1807.92". But my setup of this method is returning "$180,792".Here's more details on what I'm using, and what I'm trying to do:ORIGINAL DB VALUE:180792CURRENT CODE:Dim strNumber As String = Trim(rsQuery("Number").Value.ToString)strNumber = (FormatCurrency(strNumber,0))CURRENT RESULT:$180,792WANTED RESULT:$1,807.92I hope that someone can help me out with this one. I'm just not sure if this method has too many limitations that I can't use, or if I'm just not adding another few steps. Any and all help is appreciated. Thanks.Try something like this: Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now