472,982 Members | 2,285 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,982 software developers and data experts.

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 8443
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**************@TK2MSFTNGP12.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**************@TK2MSFTNGP12.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.Globalization.CultureInfo.NumberFormat in effect for the page ,
correct ?

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:ur**************@tk2msftngp13.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**************@TK2MSFTNGP12.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**************@TK2MSFTNGP10.phx.gbl...
if i use "c" , the formatting then follows the
System.Globalization.CultureInfo.NumberFormat in effect for the page ,
correct ?

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:ur**************@tk2msftngp13.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**************@TK2MSFTNGP12.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***@bellsouth.net> wrote in message
news:ON*************@TK2MSFTNGP12.phx.gbl...
Hi,

yes

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

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:ur**************@tk2msftngp13.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**************@TK2MSFTNGP12.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%****************@TK2MSFTNGP11.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***@bellsouth.net> wrote in message
news:ON*************@TK2MSFTNGP12.phx.gbl...
Hi,

yes

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

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:ur**************@tk2msftngp13.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**************@TK2MSFTNGP12.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
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...
1
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
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...
4
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
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
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...
2
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...
2
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...
2
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...
7
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...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.