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

Re: Number Formats by OHM

OHM
Mon Apr 03 13:45:19 CDT 2006

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



"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
>
>
>
>



Re: Number Formats by v-kevy

v-kevy
Mon Apr 03 22:12:49 CDT 2006

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."


Re: Number Formats by Vayse

Vayse
Tue Apr 04 06:37:34 CDT 2006

"OHM ( One Handed Man )" <me@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.



Re: Number Formats by Vayse

Vayse
Tue Apr 04 09:49:43 CDT 2006

"Kevin Yu [MSFT]" <v-kevy@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



Re: Number Formats by Dan,

Dan,
Tue Apr 04 10:23:57 CDT 2006

What about FormatNumber(drEconomy("Cash"),0)

Dan

"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
>
>
>
>



Re: Number Formats by Patrice

Patrice
Tue Apr 04 11:05:00 CDT 2006

N0 will display the value without decimal places...
--

"Vayse" <vayse@nospam.nospam> a écrit dans le message de news:
uNzzDc$VGHA.5916@TK2MSFTNGP12.phx.gbl...
> "Kevin Yu [MSFT]" <v-kevy@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
>



Re: Number Formats by v-kevy

v-kevy
Tue Apr 04 20:55:22 CDT 2006

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."