473,698 Members | 2,737 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

format string for currency

i thought the following would work for currency

{0:$000,000,000 .00}

but it is displaying ( for example ) :

$000,025,368.87

i don't want the extra zeros ...
Nov 20 '05 #1
6 8484
try this
{0:$###,##0.00}

but I think there must exist a shortcut ;-)

"John A Grandy" <johnagrandy-at-yahoo-dot-com> wrote in message
news:uc******** ******@TK2MSFTN GP12.phx.gbl...
i thought the following would work for currency

{0:$000,000,000 .00}

but it is displaying ( for example ) :

$000,025,368.87

i don't want the extra zeros ...

Nov 20 '05 #2
Hi,

Dim c As Decimal = 12.68

Me.Text = c.ToString("c")

http://msdn.microsoft.com/library/de...matStrings.asp

Ken

-------------------------

"John A Grandy" <johnagrandy-at-yahoo-dot-com> wrote in message
news:uc******** ******@TK2MSFTN GP12.phx.gbl...
i thought the following would work for currency

{0:$000,000,000 .00}

but it is displaying ( for example ) :

$000,025,368.87

i don't want the extra zeros ...

Nov 20 '05 #3
if i use "c" , the formatting then follows the
System.Globaliz ation.CultureIn fo.NumberFormat in effect for the page ,
correct ?

"Ken Tucker [MVP]" <vb***@bellsout h.net> wrote in message
news:ur******** ******@tk2msftn gp13.phx.gbl...
Hi,

Dim c As Decimal = 12.68

Me.Text = c.ToString("c")

http://msdn.microsoft.com/library/de...matStrings.asp
Ken

-------------------------

"John A Grandy" <johnagrandy-at-yahoo-dot-com> wrote in message
news:uc******** ******@TK2MSFTN GP12.phx.gbl...
i thought the following would work for currency

{0:$000,000,000 .00}

but it is displaying ( for example ) :

$000,025,368.87

i don't want the extra zeros ...


Nov 20 '05 #4
Hi,

yes

Ken
-----------------
"John A Grandy" <johnagrandy-at-yahoo-dot-com> wrote in message
news:ej******** ******@TK2MSFTN GP10.phx.gbl...
if i use "c" , the formatting then follows the
System.Globaliz ation.CultureIn fo.NumberFormat in effect for the page ,
correct ?

"Ken Tucker [MVP]" <vb***@bellsout h.net> wrote in message
news:ur******** ******@tk2msftn gp13.phx.gbl...
Hi,

Dim c As Decimal = 12.68

Me.Text = c.ToString("c")

http://msdn.microsoft.com/library/de...matStrings.asp

Ken

-------------------------

"John A Grandy" <johnagrandy-at-yahoo-dot-com> wrote in message
news:uc******** ******@TK2MSFTN GP12.phx.gbl...
>i thought the following would work for currency
>
> {0:$000,000,000 .00}
>
> but it is displaying ( for example ) :
>
> $000,025,368.87
>
> i don't want the extra zeros ...
>
>



Nov 20 '05 #5
Ok ...

But what if I want a shorthand format-specifier that does not rely on any
more-global objects (such as CultureInfo). Must such specifiers always be
designated character-by-character ?

For example, if I want to display currency with a dollar-sign prefix, each
group of 3 digits separated by a comma, no decimal point or decimal places,
and blank for negative or zero values, then I would have to use something
like

"$###,###,###;; "

But how to cover the case where the currency value might be larger? (more
than 9 digits might need to be present)


"Ken Tucker [MVP]" <vb***@bellsout h.net> wrote in message
news:ON******** *****@TK2MSFTNG P12.phx.gbl...
Hi,

yes

Ken
-----------------
"John A Grandy" <johnagrandy-at-yahoo-dot-com> wrote in message
news:ej******** ******@TK2MSFTN GP10.phx.gbl...
if i use "c" , the formatting then follows the
System.Globaliz ation.CultureIn fo.NumberFormat in effect for the page ,
correct ?

"Ken Tucker [MVP]" <vb***@bellsout h.net> wrote in message
news:ur******** ******@tk2msftn gp13.phx.gbl...
Hi,

Dim c As Decimal = 12.68

Me.Text = c.ToString("c")

http://msdn.microsoft.com/library/de...matStrings.asp

Ken

-------------------------

"John A Grandy" <johnagrandy-at-yahoo-dot-com> wrote in message
news:uc******** ******@TK2MSFTN GP12.phx.gbl...
>i thought the following would work for currency
>
> {0:$000,000,000 .00}
>
> but it is displaying ( for example ) :
>
> $000,025,368.87
>
> i don't want the extra zeros ...
>
>



Nov 20 '05 #6
again...
I have no MVP in my name so it is not good enough???

format {0:$###,##0.00} for 123456789 shows "123,456,789.00 "
"John A Grandy" <johnagrandy-at-yahoo-dot-com> wrote in message
news:O%******** ********@TK2MSF TNGP11.phx.gbl. ..
Ok ...

But what if I want a shorthand format-specifier that does not rely on any
more-global objects (such as CultureInfo). Must such specifiers always be
designated character-by-character ?

For example, if I want to display currency with a dollar-sign prefix, each
group of 3 digits separated by a comma, no decimal point or decimal places, and blank for negative or zero values, then I would have to use something
like

"$###,###,###;; "

But how to cover the case where the currency value might be larger? (more
than 9 digits might need to be present)


"Ken Tucker [MVP]" <vb***@bellsout h.net> wrote in message
news:ON******** *****@TK2MSFTNG P12.phx.gbl...
Hi,

yes

Ken
-----------------
"John A Grandy" <johnagrandy-at-yahoo-dot-com> wrote in message
news:ej******** ******@TK2MSFTN GP10.phx.gbl...
if i use "c" , the formatting then follows the
System.Globaliz ation.CultureIn fo.NumberFormat in effect for the page ,
correct ?

"Ken Tucker [MVP]" <vb***@bellsout h.net> wrote in message
news:ur******** ******@tk2msftn gp13.phx.gbl...
> Hi,
>
> Dim c As Decimal = 12.68
>
> Me.Text = c.ToString("c")
>
>
>
>

http://msdn.microsoft.com/library/de...matStrings.asp
>
>
>
> Ken
>
> -------------------------
>
> "John A Grandy" <johnagrandy-at-yahoo-dot-com> wrote in message
> news:uc******** ******@TK2MSFTN GP12.phx.gbl...
> >i thought the following would work for currency
> >
> > {0:$000,000,000 .00}
> >
> > but it is displaying ( for example ) :
> >
> > $000,025,368.87
> >
> > i don't want the extra zeros ...
> >
> >
>
>



Nov 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
9606
by: Dalan | last post by:
This should not be an issue, but it is. I'm sure that someone knows what little piece of code is needed too persuade Access 97 to include a currency format for labels (Avery, mailing type). Have had no problems with currency formatting on reports - just the labels. Doesn't matter if the associated field in the Table and Form have Format as Currency, because on the labels (for instance $50.00) prints as: 50 The only way to get it to print...
1
15472
by: Mike MacSween | last post by:
This looks like a bug to me. I have an expression on a report: =Format(Sum((**)*(/)),"0.00") Score is byte PercentOfGrade is double PropDegree is single ModuleCats is byte
2
2230
by: DD | last post by:
I have a UnionQry that is run from StatementsI and StatementP. the Due and Paid colunms are currency and show the $ however when i union the two the currency format has gone. Any help please SELECT * FROM qryStatementI UNION SELECT * FROM qryStatementP ORDER BY thedate;
4
22590
by: Gerry Abbott | last post by:
Hi All. How can i put a zero decimal for my currency into my format statement, == & ", for " & & " days. Cost " & Format(,"Currency") which is the data source for a textbox on a report
7
4535
by: zlf | last post by:
1ˇ˘Here is a number. double nu = 123 2ˇ˘Format it with 3ˇ˘The result is "$123" I want to ask how to deformat "$123" to 123 Thx (Currency symbol is not restricted to '$')
3
3080
by: Slonocode | last post by:
I have some textboxes bound to an access db. I wanted to format the textboxes that displayed currency and date info so I did the following: Dim WithEvents oBidAmt As Binding oBidAmt = New Binding("Text", Me.Ds1, "Items.BidAmt") txtBidAmt.DataBindings.Add(oBidAmt) Private Sub oBidAmt_Format(ByVal sender As Object, ByVal e As System.Windows.Forms.ConvertEventArgs) Handles oBidAmt.Format
2
12508
by: AMDRIT | last post by:
Hello Everyone, I would like to format the Display Members of a combobox's datasource. Is there a way to apply a format without subclassing the original datasource? For example, given a list of decimal values, format them as currency values with a leading currency symbol and 2 decimal places. TIA Class Test
2
1579
by: crferguson | last post by:
Hello all! I'm having the oddest issue trying to format a numeric string as currency without decimals. For instance... strSalary = "120000.56" strSalary = Format(strSalary, "$#,##0") 'this one returns "$#,##0" literally, no number strSalary = Format(strSalary, "C0") 'this one returns "C0" literally, no number
2
2142
by: Dhananjay | last post by:
Hi all , I have got problem when i am tring to exportGridview Data into Excel format. It is going into text format ,but what i want is if the field is number/currency then it should go into number/currency format itself .Data exported to excel are all exported as text. Export to excel should maintain the formatting like numbers and money should be numbers and money in excel .
7
2056
by: Nariban Barkan | last post by:
Hi All, I have a decimal value on the GridView BoundField which comes from sql server and it seems on gridview like that; 2096.62 14899.01 I want to display that values like 2.096,62 14.899,01
0
8683
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8610
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8873
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4372
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4623
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2339
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.