Home All Groups Group Topic Archive Search About
Author
3 Apr 2006 5:23 PM
Vayse
I want to display numbers with a comma between every 3 digits, with no
decimal places.
I've tried
Const conFORMAT As String = "###,###,###"

Me.CashTextBox.Text = Format(drEconomy("Cash"), conFORMAT)

Which displays fine in general. For example:  999,817 will come out fine

However, if the value is zero, then the text box will be empty. Is there a
different format I can use to get 0 to displayed correclty?

Thanks

Vayse

Author
3 Apr 2006 6:45 PM
OHM ( One Handed Man )
Not really sure how you want a zero to be formatted, but

(0).ToString("000,000,000") '//Produces  000,000,000


--
( OHM ) - One Handed Man
AKA Terry Burns - http://TrainingOn.net



Show quote
"Vayse" <vayse@nospam.nospam> wrote in message
news:OaNZfN0VGHA.4792@TK2MSFTNGP14.phx.gbl...
>I want to display numbers with a comma between every 3 digits, with no
>decimal places.
> I've tried
> Const conFORMAT As String = "###,###,###"
>
> Me.CashTextBox.Text = Format(drEconomy("Cash"), conFORMAT)
>
> Which displays fine in general. For example:  999,817 will come out fine
>
> However, if the value is zero, then the text box will be empty. Is there a
> different format I can use to get 0 to displayed correclty?
>
> Thanks
>
> Vayse
>
>
>
>
Author
4 Apr 2006 3:12 AM
Kevin Yu [MSFT]
Hi Vayse,

This is by design, if a digit is 0, the # will automatically ignore it and
display nothing. Please try to use a pre-defined format string like

Me.TextBox1.Text = Format(0, "N")

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
Author
4 Apr 2006 2:49 PM
Vayse
"Kevin Yu [MSFT]" <v-k***@online.microsoft.com> wrote in message
news:tGqhwW5VGHA.5252@TK2MSFTNGXA01.phx.gbl...
> Hi Vayse,
>
> This is by design, if a digit is 0, the # will automatically ignore it and
> display nothing. Please try to use a pre-defined format string like
>
> Me.TextBox1.Text = Format(0, "N")
>

Thanks, but I don't think there is a pre-defined format that matches. "N"
will still display decimal places, which I don't want to do.
I know I can check in code if the number is zero, then use a different
format, but I'm hoping there is a format that would suit.
Vayse
Author
4 Apr 2006 4:05 PM
Patrice
N0 will display the value without decimal places...
--

"Vayse" <vayse@nospam.nospam> a écrit dans le message de news:
uNzzDc$VGHA.5***@TK2MSFTNGP12.phx.gbl...
Show quote
> "Kevin Yu [MSFT]" <v-k***@online.microsoft.com> wrote in message
> news:tGqhwW5VGHA.5252@TK2MSFTNGXA01.phx.gbl...
>> Hi Vayse,
>>
>> This is by design, if a digit is 0, the # will automatically ignore it
>> and
>> display nothing. Please try to use a pre-defined format string like
>>
>> Me.TextBox1.Text = Format(0, "N")
>>
>
> Thanks, but I don't think there is a pre-defined format that matches. "N"
> will still display decimal places, which I don't want to do.
> I know I can check in code if the number is zero, then use a different
> format, but I'm hoping there is a format that would suit.
> Vayse
>
Author
5 Apr 2006 1:55 AM
Kevin Yu [MSFT]
Thanks for Patrice's suggestion, N0 will do the trick.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
Author
4 Apr 2006 11:37 AM
Vayse
"OHM ( One Handed Man )" <m*@mine.com> wrote in message
news:OERLb70VGHA.2760@TK2MSFTNGP11.phx.gbl...
> Not really sure how you want a zero to be formatted, but
>
> (0).ToString("000,000,000") '//Produces  000,000,000
>

I don't want zero formatted. If its zero, I just want 0 displayed.
Author
4 Apr 2006 3:23 PM
Dan, Vascas
What about FormatNumber(drEconomy("Cash"),0)

Dan

Show quote
"Vayse" <vayse@nospam.nospam> wrote in message
news:OaNZfN0VGHA.4792@TK2MSFTNGP14.phx.gbl...
>I want to display numbers with a comma between every 3 digits, with no
>decimal places.
> I've tried
> Const conFORMAT As String = "###,###,###"
>
> Me.CashTextBox.Text = Format(drEconomy("Cash"), conFORMAT)
>
> Which displays fine in general. For example:  999,817 will come out fine
>
> However, if the value is zero, then the text box will be empty. Is there a
> different format I can use to get 0 to displayed correclty?
>
> Thanks
>
> Vayse
>
>
>
>

AddThis Social Bookmark Button