473,748 Members | 5,849 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 8488
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
9609
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
15475
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
2236
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
22596
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
4539
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
3084
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
12510
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
1584
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
2146
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
2059
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
8984
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
8823
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
9530
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9312
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6793
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4593
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...
1
3300
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
2775
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2206
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.