format-string

"Intelligent" cast of double to two differently formatted strings?

I'm working with a database that has the limit that the only (numeric) datatype it can store is a double. What I want to do is pick the number for a certain row and put it into an HTTP request. The problem revolves around that I cannot know if this number should or should not have decimals. For example, if the double is an ID, I cannot ...

Is it possible to use format strings to align NSStrings like numbers can be?

I'm using NSLog() to print some tabular data consisting of an NSString and an associated integer. Assume I know the length of the longest word. Is there a way using format strings to get this kind of column alignment: word:tree rank:5 word:frog rank:3 word:house rank:2 word:peppercorn rank:2 word:swor...

How to escape the % sign in C's printf?

How do you escape the % sign when using printf in C? printf("hello\%"); /* not like this */ ...

Is %dn a format string ?

Hi , I recently came across this line in a code - fprintf(logfile," |-IP Version : %dn",(unsigned int)iph->version); Is "%dn" here a format string ? If so , what does it signify ? ...

Platform independent size_t Format specifiers in c?

I want to print out a variable for type size_t in c but it appears that size_t is aliased to different variable types on different architextures. For example on one machine (64-bit) the following code does not throw any warmings: size_t size = 1; printf("the size is %ld", size); but on my other machine (32_bit) the above code produces...

MDX format_string for % doesn't multiply by 100 when % sign is at the front

For the following query: with member testVal as 0.1234 member testNormal as testVal member testPrepend as testVal, format_string="%##.00" member testMidpend as testVal, format_string="##%.00" member testAppend as testVal, format_string="##.00%" select { testNormal, testPrepend, testMidpend, testAppend} on axis (0) from [SomeRandomPlace...

User selects something in combobox, something else is sent to dependency property

In my application the user can select how a date is displayed. Most of the standard datetime format strings can be selected. My problem now is that the average user doesnt understand the difference between "m" and "D". What I want to do is change this so that, as excel does, rather than showing the format string, I show how an arbitrary ...

lua string printing

In C, I have format strings, something like: char *msg = "wlll you marry me" fprintf(stderr, "%s, %s?", name, msg); Now, can I do something similar in lua with format strings? I.e. I want something functionally equivalent to: name .. ", " .. msg .. "?" but not so ugly, in lua. Okay, so I can do string.format("%s, %s?", name, msg),...

Is there a standard format string in ASP.NET to convert 1/2/3/... to 1st/2nd/3rd...?

I have an integer in an Access database, which is being displayed in ASP.NET. The integer represents the position achieved by a competitor in a sporting event (1st, 2nd, 3rd, etc.), and I'd like to display it with a standard suffix like 'st', 'nd', 'rd' as appropriate, rather than just a naked number. An important limitation is that thi...

.net Masked Text Box

What is the mask for "percentage", in a WinForms application (VB.net)? ...

Do you know about %#x, in C language format string.

KdPrint(( "Unknown IoControlCode %#x\n", io_stack->Parameters.DeviceIoControl.IoControlCode )); It's weird. What does sharp mean? ...

What does data="@/some/path" mean in Python?

This is from some code I'm looking at... I think it's some sort of special format string that loads the file at the path into a binary string assigned to data, but I'm not sure as when I try to replicate it all I get is a standard string. Or is it actually a standard string and I'm reading too much into it? ...

size limit of printf conversion specification

printf conversion specifications are % followed by flags, width, precision, length modifier and conversion specifier. Is there practical limit to size of a conversion specification? I.e. %s is 2 chars long, while %08.2f is 6 chars long. My question is, what is the length of the maximal single specification in a format string that can be...

What does an 'F' in the Format specifier of printf mean ?

What does %.8Ff format specifier in printf do?What does F mean? ...