formatting Questions
24
Solved
For every typescript file visual studio code uses an auto indentation of 8 spaces. This is a bit too much for my taste but I can't find where to change it.
Maybe it's available as a setting but un...
Sickler asked 9/12, 2015 at 8:40
9
Solved
We are creating PDF documents on the fly from the database using PDFsharp.
I need to know the best way to calculate the height of the text area based
on the font used and the available width.
I n...
Ynez asked 23/5, 2009 at 10:53
18
I prefer my own style of code formatting as opposed to Visual Studio's default settings. I've turned off auto-formatting options in Tools→Options. In most cases, it works.
However, after using any ...
Mathia asked 10/4, 2009 at 10:14
11
Solved
Is there a format for printing Python datetimes that won't use zero-padding on dates and times?
Format I'm using now:
mydatetime.strftime('%m/%d/%Y %I:%M%p')
Result: 02/29/2012 05:03PM
Desired:...
Mintz asked 1/3, 2012 at 23:41
4
Solved
I need to write the below data to yaml file using Python:
{"A": "a", "B": {"C": "c", "D": "d", "E": "e"}}
...
Horseflesh asked 18/9, 2012 at 5:4
1
When I open up pom.xml with Maven POM Editor and try to format using default shortcut ctrl + shift + f I expect the file to be formatted as any other .xml with rules that are configured in Preferen...
Propose asked 17/5, 2022 at 6:46
17
Solved
How to format numbers like SO with C#?
10, 500, 5k, 42k, ...
Devolution asked 25/1, 2010 at 17:25
4
Solved
I have a TextBlock that is bound to a DateTime property. How do I configure the format of the date?
Pluralize asked 26/8, 2009 at 7:58
5
Solved
I use a negative index in replacement fields to output a formatted list,but it raises a TypeError.The codes are as follows:
>>> a=[1,2,3]
>>> a[2]
3
>>> a[-1]
3
>>> 'The last:{0[2]}'.format(a)
'T...
Fulgurant asked 25/10, 2009 at 7:16
2
Solved
I know to print int we can use %d, and string we can use %s
but we can still use %v to print them. So what if I always use %v to print them? What issue will happen if I do this?
Frontlet asked 15/12, 2016 at 8:2
6
Solved
I am making a report about my program and I need copy all the code to an MS document. The problem is that I need to keep every colour as it is. I've tried using Notepad++ for this and online conver...
Porterporterage asked 17/3, 2019 at 16:43
37
Solved
I need to show a currency value in the format of 1K of equal to one thousand, or 1.1K, 1.2K, 1.9K etc, if its not an even thousands, otherwise if under a thousand, display normal 500, 100, 250 etc,...
Sandpiper asked 27/2, 2012 at 7:52
15
Solved
I am looking to format a number like 188518982.18 to £188,518,982.18 using Python.
How can I do this?
Jolly asked 26/11, 2008 at 14:43
19
Solved
How do you left pad an int with zeros when converting to a String in java?
I'm basically looking to pad out integers up to 9999 with leading zeros (e.g. 1 = 0001).
Longsufferance asked 23/1, 2009 at 15:21
15
Suppose we have
var number = 123456.789;
What I want is to display this number in locale 'de-DE' as
123.456,79
in locale 'ja-JP' as
123,457
in locale 'en-US' as
123,456.79
and so on according t...
Axillary asked 7/7, 2017 at 11:38
11
Solved
One of the things that used to perplex me as a newby to R was how to format a number as a percentage for printing.
For example, display 0.12345 as 12.345%. I have a number of workarounds for this,...
Unquiet asked 22/8, 2011 at 10:5
11
Let's say I type in the following code and format it.
if (condition) { /* Hello! */ }
If this is C# code, it is formatted like this:
if (condition)
{
// Hello!
}
If it is JavaScript, VSCode ...
Colpin asked 2/10, 2015 at 5:14
3
Solved
I have an 800kb *.json file all condensed into one line.
The built-in JSON formatter seems to refuse to format and tokenize the file and after searching for a while I haven't found any solutions. H...
Regarding asked 10/12, 2019 at 9:51
19
Solved
Can I do it with System.out.print?
Pemberton asked 29/3, 2010 at 14:45
5
In Visual Studio & other IDEs, you can easily auto format your code with a keyboard shortcut, through the menu, or automatically as you type.
I was wondering if there is yet a way to enable th...
Formal asked 31/12, 2008 at 0:28
11
Solved
Problem: I need to convert an amount to Indian currency format
My code: I have the following Python implementation:
import decimal
def currencyInIndiaFormat(n):
d = decimal.Decimal(str(n))
if d...
Proteiform asked 3/12, 2016 at 19:19
12
Solved
I am using prettier to format my code in VS Code but I really dislike how it does it.
My main beef is it splitting attributes over multiple lines.
<input
type="checkbox"
name="asiaNews"
id=...
Trounce asked 24/5, 2019 at 10:56
12
I have an array with elements, for example array = ["example1", "example2", "example3"].
How can I print it in the following format?
example1 2. example2 3. example 3...
Heck asked 18/10, 2015 at 13:25
10
Solved
I am learning C++. cout is an instance of std::ostream class.
How can I print a formatted string with it?
I can still use printf, but I want to learn a proper C++ method which can take advantage ...
Windbroken asked 27/2, 2013 at 7:7
2
Solved
I have the following line in Powershell to output an array of data. The problem I am having is that Name,Title,Department do not go into columns. Instead I get a single column with each row in a si...
Tolan asked 2/5, 2014 at 18:1
© 2022 - 2024 — McMap. All rights reserved.