473,672 Members | 2,813 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Response.Write( String.Format(" {0:#,###.##}",0 )); returns empty string

I use the following code to format the numbers to have commas. But in case
when input is zero it returns an empty string....any ideas?

String.Format(" {0:#,###.##}",d blNum);

Nov 15 '05 #1
2 7427
On Mon, 10 Nov 2003 01:04:03 +0530, "Von Shean" <vo******@hotma il.com> wrote:
I use the following code to format the numbers to have commas. But in case
when input is zero it returns an empty string....any ideas?

String.Format( "{0:#,###.##}", dblNum);


http://msdn.microsoft.com/library/de...matstrings.asp
According to your format, zero is supposed to format to an empty string.

bullshark

Nov 15 '05 #2
Von Shean wrote:
I use the following code to format the numbers to have commas. But in case
when input is zero it returns an empty string....any ideas?

String.Format(" {0:#,###.##}",d blNum);


You want something like:

String.Format(" {0:#,##0.00}",d blNum);

depending on whether or not you always want to display 2 digits after
the decimal.

--
mikeb

Nov 15 '05 #3

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

Similar topics

0
2199
by: Pieter Linden | last post by:
Hi, I guess this question is directed at Randy Birch, but as I haven't the money to go help him move and clean up his house, I guess I don't have the right to ask him directly... so here goes. I'm using a chunk of his functions to resolve Hostnames into IP addresses and MAC addresses and the like... all of it works fine - except this function, and I have no idea why... Of course, you'll probably tell me to kindly put the light sabre...
2
312
by: Phil Galey | last post by:
I created a VB.NET application, together with an associated installation project, and in the installation project I specified the ProductName. But when I run the application, if I try to retrieve the ProductName using Application.ProductName, it always returns an empty string. I've looked under Solution Properties, but haven't found anything. How do I get Application.ProductName to return the application product name? Thanks.
0
1190
by: JP | last post by:
Hi, I did set the assembly attribute: <Assembly: AssemblyProduct("Verzorgingsplaatsen")> but when I call Application.Productname it returns an empty string. What's wrong? JP
2
1787
by: lauralucas | last post by:
Hello I'm trying to use a connection string stored in web.config here is the web.config part <appSettings> <add key="NDDbase" value="Server=SOMESERVER\\SOMEINSTANCE;integrated security=SSPI;database=NDD"/>
0
1105
by: kurt sune | last post by:
I have written a Custom Validator. However the ServerValidate(ByVal source As Object, ByVal args As ServerValidateEventArgs): sub gets called twice. First with an empty args-argument, secondly with a correct value. By debugging I found that the first call to Me.GetControlValidationValue(Me.ControlToValidate)
3
5044
by: RMB | last post by:
Environment: FW 1.x VB.net When making a call to MainWindowTitle from a windows service an empty string is returned. All of the application processes being checked have UI with titles. If I run the same code from a test windows application, MainWindowTitle returns a value. Is there an issue with calling MainWindowTitle from a windows service? The code is able to see the process, but just unable to retrieve the MainWindowTitle. ...
6
20945
by: Michi Henning | last post by:
I'm running the following code in Safari 2.0.4: document.cookie = 'MyCookie=1'; if(document.cookie == '') alert('document.cookie is empty!'); document.cookie always returns the empty string, no matter what I do. I checked the cookie settings in Safari->Preferences->Security. Even when I set cookies to be always accepted, document.cookie still returns the empty string.
3
9441
by: Renilkumar | last post by:
I have a datagrid using link button. I am setting the CommandArgument value as .. <asp:linkbutton runat="server" EnableViewState=True CommandArgument='<%# DataBinder.Eval(Container.DataItem, "EmpId")%>' ....> In the .aspx.vb file I am referring this value as..
3
2831
by: comp.lang.php | last post by:
PHP 5.2.0 when using mime_content_type("/path/to/my/video.avi") I get an empty string every time When I am supposed to get video/x-msvideo
0
8503
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
8419
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
8844
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8696
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...
1
6254
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
4239
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
4439
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2836
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
2092
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.