Commonly refers to a number of methods to display an arbitrary number of varied data types into a string.

learn more… | top users | synonyms (1)

1
vote
1answer
26 views

FormatException when using “X” for hexadecimal formatting

I took the following code from HexConverter - Unify Community Wiki string hex = color.r.ToString("X2") + color.g.ToString("X2") + color.b.ToString("X2"); This gives me the exception: ...
4
votes
1answer
27 views

floats in NumPy structured array and native string formatting with .format()

Can anyone tell me why this NumPy record is having trouble with Python's new-style string formatting? All floats in the record choke on "{:f}".format(record). Thanks for your help! In [334]: ...
3
votes
4answers
74 views

C Sharp DateTime Format

UPDATE This looks to be a bug in Windows 7. I tested the same scenario with Windows 8 and I cannot replicate this there. Please see the MS Bug Report that I posted on this issue if you want more ...
1
vote
1answer
22 views

Error Data binding on dropdown list

I Have Dropdwon on my aspx page : <td> <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SqlDataSource1" DataTextFormatString = "{0} - {1}" DataTextField = ...
0
votes
3answers
58 views

Strange behaviour of printf string format in C

I have the function below in nesCwhich is essentially same as C as far as I understood! event void AdaptiveSampling.dataAvailable(error_t result, float val, bool isRealData) { if(result == ...
-4
votes
1answer
49 views

Need to convert date format in different way in c#? [closed]

I need to convert following date format in C# Actual : 5/20/2010 3:01:18 PM ==> (IST) Required : 20 May 2010 09:31:18 AM ==> (GMT) Is there any built in function in C#?
0
votes
2answers
27 views

Space is not coming when formatting string in php

When I am using printf, I am not being able to give space. This is my code: $number1=12.30; $number2=1; $f_number1 = sprintf("%9.2f",$number1); $f_number2 = sprintf("%9.2f",$number2); echo ...
0
votes
4answers
54 views

compute age from given birthdate

I have 2 comboboxes and 2 textboxes. My first combobox contains months in this format january, february, etc, and the other combobox contains numbers from 1 to 31. My first textbox is txtyear. Once ...
0
votes
1answer
25 views

printing string with and without “Strings-Formatting”

I'm trying to find out why I'm seeing this. This is the code-snippet: def check_status(addr,port=80): import urllib2 if not addr.startswith('http://'): addr = "http://" + addr req = ...
1
vote
1answer
22 views

python string formatting from list with arbitrary item

I want to do a string formatting with a list as showed below: (pseudocode) down_url = [url1, url2, ..., urln] url = "download: %s" % down_url Yes, the list down_url has arbitrary items, and I ...
0
votes
1answer
41 views

String Format when Export to Excel From gridview

I Have export Gridview data to excel, here's my code : Protected Sub btnExport_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExport.Click Try Dim dt As ...
0
votes
1answer
18 views

Range.Replace not formating as expected

I am trying to do something that should be simple. I have VBA code in a excel macro that is to change some text. So, for example, change "Text 111" to text "001" The code runs, and changes the text ...
0
votes
1answer
23 views

In a python logging is there a formatter to truncate the string?

Python logging formats strings with a syntax I don't see elsewhere in python, like 'format': '%(name)s' Is there any way to truncate an error message using the formatter, or do I need to override ...
1
vote
1answer
37 views

Trying to format php time 12hr no leading zeros

I feel stupid asking - but I've had a problem with my time format. Using php and pulling date/time from a MySQL db I am trying to format a time display so there are no leading zero characters in my 12 ...
0
votes
3answers
34 views

Numeric Specifier for prefixing single digit with 0

I need to numeric format specifier, so as to prefix single digit with 0. I need: 1=01 2=02 : : : 9=09 The two and three digits will remain as it is no changes 10=10 11=11 : :

1 2 3 4 5 77
15 30 50 per page