Top "String-formatting" questions

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

Fixed width number formatting python 3

How do I get an integer to fill 0's to a fixed width in python 3.2 using the format attribute? Example: …

string formatting python-3.x string-formatting fixed-width
Format decimal value to string with leading spaces

How do I format a decimal value to a string with a single digit after the comma/dot and leading …

c# .net vb.net string-formatting
Python add leading zeroes using str.format

Can you display an integer value with leading zeroes using the str.format function? Example input: "{0:some_format_specifying_width_3}".…

python string python-2.7 string-formatting
Python 3 bytes formatting

In Python 3, one can format a string like: "{0}, {1}, {2}".format(1, 2, 3) But how to format bytes? b"{0}, {1}, {2}".format(1, 2, 3) raises AttributeError: 'bytes' object …

python python-3.x string-formatting
String format using MultiBinding?

I'm trying to display a string in XAML using Label control. Following is my XAML code : <Label Height="28" HorizontalAlignment="…

wpf xaml multibinding string-formatting
Turn byte into two-digit hexadecimal number just using ToString?

I can turn a byte into a hexadecimal number like this: myByte.ToString("X") but it will have only one …

c# .net string-formatting
Format a Number to a specific QString format

I have a question about formatting a decimal number to a certain QString format. Basically, I have an input box …

c++ qt string-formatting qstring
Get AM/PM for a date time in lowercase using only a datetime format

I'm to get a custom DateTime format including the AM/PM designator, but I want the "AM" or "PM" to …

.net datetime string-formatting
Using .format() to format a list with field width arguments

I recently (finally?) started to use .format() and have a perhaps a bit obscure question about it. Given res = ['Irene …

python list string-formatting
Logging variable data with new format string

I use logging facility for python 2.7.3. Documentation for this Python version say: the logging package pre-dates newer formatting options such …

python python-2.7 string-formatting