473,791 Members | 3,275 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 7438
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
2205
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
1198
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
1795
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
1114
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
5059
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
21035
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
9453
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
2842
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
10207
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...
1
10156
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,...
0
9997
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...
0
9030
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7537
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
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5559
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3718
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2916
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.