format Questions

8

Solved

I was asked to do a work in C when I'm supposed to read from input until there's a space and then until the user presses enter. If I do this: scanf("%2000s %2000s", a, b); It will follow the 1st...
Together asked 11/11, 2011 at 17:21

3

Solved

I have a float value: 12345.6489 When I format this using: (12345.6489f).ToString("F1") Then I get a result of 12345.7 But this is incorrect, since it should be 12345.6. Does anyone understan...
Liquidize asked 14/1, 2013 at 19:27

12

Solved

I'm using the C++ Extension for VSCode (Visual Studio Code). Currently, I have the setting "C_Cpp.clang_format_formatOnSave" set to true. This format's my code when I save my C++ file. But the fo...
Perverted asked 8/9, 2017 at 8:18

3

Solved

The format function in builtins seems to be like a subset of the str.format method used specifically for the case of a formatting a single object. eg. >>> format(13, 'x') 'd' is appar...
Stricklin asked 22/5, 2013 at 4:33

6

Solved

How can I format the time elapsed from seconds to hours, mins, seconds? My code: start = time.time() ... do something elapsed = (time.time() - start) Actual Output: 0.232999801636 Desired/E...
Habakkuk asked 5/1, 2015 at 12:36

9

Solved

I'm having a problem formatting cells in an Excel sheet. For some reason my code seems to be changing the style of all cells when I just want to change the style of a few specified, or a specified ...
Octaviaoctavian asked 17/7, 2012 at 19:52

3

Solved

I'd like Intl.NumberFormat() to automatically convert between units from smaller to bigger ones based on common rules. I.e. a given number should be converted to between centimeters, meters, and ki...
Adhesion asked 21/4, 2021 at 20:0

17

Solved

I'm having a problem with two dimensional array. I'm having a display like this: 1 2 3 4 5 6 7 9 10 11 12 13 14 15 16 . . . etc What basically I want is to display to display it as: 1 2 3 4 5 6...
Goshawk asked 11/10, 2012 at 17:29

11

Solved

I have to format numbers as thousands separators in dart. I have numbers like: 16987 13876 456786 and I want to format them as : 16,987 13,876 4,56,786
Nosography asked 25/6, 2020 at 16:44

15

Solved

I'm trying to write a function to present thousands and millions into K's and M's For instance: 1000 = 1k 1100 = 1.1k 15000 = 15k 115000 = 115k 1000000 = 1m Here is where I got so far: func for...
Apulia asked 2/4, 2016 at 17:58

8

Solved

How can I do this format with a Python 3.6 F-String? person = {'name': 'Jenne', 'age': 23} print('My name {0[name]} and my age {1[age]}'.format(person, person)) print('My name {0} and my age {1}'....
Remiss asked 19/4, 2017 at 6:33

3

Solved

Basically, I am using the following code to parse string as LocalDateTime, which works fine most of the time. DateTimeFormatter dtformatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS"); H...
Jumpoff asked 22/4, 2018 at 14:40

5

Solved

Why does this print the value of the memory address at 0x08480110? I'm not sure why there are 5 %08x arguments - where does that take you up the stack? address = 0x08480110 address (encoded as 32...
Moustache asked 15/4, 2011 at 6:9

7

Solved

Hi I need to remain only with the day of each date: df<-data.frame(x=c("2014-07-24 00:00:00", "2014-07-24 00:00:00", "2014-07-11", "2014-07-11" ,"2014-07-16" ,"2014-07-14")) as.Date(df$x,forma...
Koziol asked 25/9, 2014 at 16:29

11

Solved

I need to get the current timestamp in Java, with the format of MM/DD/YYYY h:mm:ss AM/PM, For example: 06/01/2000 10:01:50 AM I need it to be Threadsafe as well. Can I utilize something like th...
Lepus asked 1/12, 2011 at 16:45

35

Solved

I'm having trouble formatting a datetime.timedelta object. Here's what I'm trying to do: I have a list of objects and one of the members of the class of the object is a timedelta object that sho...
Fulviah asked 11/2, 2009 at 20:40

2

Solved

I want to create a diagram from a pandas dataframe where the axes ticks should be percentages. With matplotlib there is a nice axes formatter which automatically calculates the percentage ticks bas...
Effect asked 7/2, 2021 at 0:14

3

Solved

Using str.format() is the new standard for formatting strings in Python 2.6, and Python 3. I've run into an issue when using str.format() with regular expressions. I've written a regular expressio...
Highlight asked 9/12, 2009 at 17:57

5

Solved

I'd like to format numbers with both thousands separator and specifying the number of decimals. I know how to do these separately, but not together. For example, I use format per this for the deci...
Charis asked 6/4, 2015 at 5:43

5

Solved

Are System.out.printf and System.out.format totally the same or perhaps they differ in somehow?
Currier asked 26/4, 2013 at 10:39

2

Solved

Let's say I have a list datalist, with len(datalist) = 4. Let's say I want each of the elements in the list to be represented in a string in this way: s = "'{0}'::'{1}'::'{2}' '{3}'\n".format(data...
Jegger asked 23/8, 2017 at 20:33

23

Solved

How do you get the text of a TextView to be Justified (with text flush on the left- and right- hand sides)? I found a possible solution here, but it does not work (even if you change vertical-cen...
Mantelet asked 18/8, 2009 at 8:32

15

Solved

I have a function to add commas to numbers: function commafy( num ) { num.toString().replace( /\B(?=(?:\d{3})+)$/g, "," ); } Unfortunately, it doesn't like decimals very well. Given the...
Cherlynchernow asked 22/7, 2011 at 1:52

2

Solved

I already saw a lot of question teaching how easy is to do it with comma as thousands separator: >>> format(1123000,',d') '1,123,000' But if I try to use a dot, it goes nuts: >>&...

5

I'd like to format a number to maximum N decimal places. There's another similar and popular question here, but that's not exactly what I'm looking for. I'm looking for something like this, let's ...
Rhine asked 13/5, 2016 at 0:38

© 2022 - 2025 — McMap. All rights reserved.