Skip to main content
Filter by
Sorted by
Tagged with
1 vote
1 answer
159 views

I'm learning C and trying to debug with printf calls. But, when I format a string with %s and have characters immediately after, they end up replacing the characters at the beginning. Example: printf(&...
Nicolas Gatien's user avatar
0 votes
1 answer
139 views

I am updating some legacy code that is a mixture of C and C++. I am using a modern compiler (C++17) and building with Makefile. I get a warning for this line of code: sscanf(data_buffer, "%d,%....
J. L.'s user avatar
  • 1
0 votes
2 answers
96 views

air_temperature = float(input()) print('{:C>.1f}'.format(air_temperature), 'C') Your output: 36.4 C Expected output 35.4C Error Message Why am I being told there is an extra space here that is ...
Alex Atheus's user avatar
0 votes
0 answers
46 views

This Excel-like layout is implemented using RecyclerView. For each EditTexts, the inputType is text because the requirement is to accepts these 2 formats: Numeric input (separated by comma each 3 ...
anta40's user avatar
  • 6,825
1 vote
1 answer
120 views

I need to format np.float64 floating values without leading digits before the dot, for example -2.40366982307 as -.240366982307E+01, in python. This is to allow me to write in RINEX 3.03 the values ...
EmmanuelMess's user avatar
0 votes
0 answers
38 views

"Streaming Text Formatting" – Formatting text that arrives in chunks from a stream. "Real-time Text Structuring" I am creating a web app using next.js and openai When I use openai ...
Zainy Shorts's user avatar
0 votes
0 answers
28 views

I am working on some old XAML that has a binding with a string format specified as {}{0,8:0.000} I believe the intent of this string format is to create a fixed length string with whitespace padding ...
Hugoagogo's user avatar
  • 1,676
1 vote
1 answer
130 views

When you convert some number to a string and pass in a format such as "00", it will insert 0's if the number doesn't have digits filling that spot. Example: 1.ToString("00") -> &...
the_pied_shadow's user avatar
1 vote
2 answers
122 views

I would like to understand what is going on with this code: float flt = 0.123F; string s1 = flt.ToString("0.#########"); // "0.123" string s2 = flt.ToString("N9"); ...
rory.ap's user avatar
  • 35.7k
1 vote
1 answer
160 views

I'm trying to specify a formatter to print mdspan of rank 2 as a matrix, quite useful. I would like at least for element formatting to work, e.g. std::println("{::.2e}", matrix) would print ...
olafwx's user avatar
  • 77
3 votes
1 answer
196 views

Given a tree-like data structure of nodes with each node having a property children that contains the children nodes from left to right, I wish to create a string representation of this data structure ...
Gigi Bayte 2's user avatar
  • 1,024
0 votes
2 answers
73 views

Is there a way to "bypass" the dot and "override" the decimals when typing a value in a TextBox in WPF formatted with a 2 decimals via StringFormat='{}{0:F2} ? When I type "1....
user avatar
-3 votes
3 answers
166 views

I have an array of 10 elements and I can each of the elements print on a new line formatted 6.2f with print(f'{myArray:6.2f}', sep="\n") But I would like to create string containing what ...
SoftwareTester's user avatar
0 votes
1 answer
298 views

I have the following Zig snippet: var buffer: [20]u8 = undefined; const precise_string = std.fmt.bufPrint(&buffer, "{d:.d}", .{ max, precision }) catch unreachable; std.debug.print("...
Palash Nigam's user avatar
  • 2,092
0 votes
1 answer
143 views

I have a google sheet where one tab is the data entry sheet named " Master Sheet". and I have another tab labeled "Charts/Tables". On the second tab I have a query pulling data ...
NateM's user avatar
  • 15
0 votes
0 answers
68 views

While working with numpy, I observed something strange. When I print a variable using print() and I format the print usingprint(f'{<variable>:.9f}) gives different values. For example, or I am ...
spacemanspiff's user avatar
0 votes
1 answer
653 views

I was modernizing some old % formatted string via regex substitution to change: # Old: 'Map: % 20s' % name # to New: 'Map: {: 20s}'.format(name) and was surprised a ValueError: Space not ...
Daraan's user avatar
  • 5,165
1 vote
0 answers
76 views

I would like to convert a set of floats to strings with 3 significant digits, e.g. 10.00 --> 10.0 10.10 --> 10.1 101.10 --> 101 Using "{:.3g}".format(x) results in 10, 10.1, 101 ...
SebaMarino's user avatar
-1 votes
1 answer
160 views

While I have checked the behavior of float64, I found the following behavior. 6 digits float64 variable's output is 100000. 7 digits float64 variable's output is 1e+06. package main import "...
ken's user avatar
  • 17
4 votes
1 answer
153 views

In Ruby, you can parse a string into a DateTime based on a given format string, for example: 3.2.4 :001 > DateTime.strptime(Time.now.to_s, '%Y-%m-%d %H:%M') Sat, 17 Aug 2024 13:31:00 +0000 3.2.4 :...
Ben G's user avatar
  • 26.9k
0 votes
2 answers
108 views

I'm rewriting an old tool (which I don't have the original code) and one of the features is to print a list with filenames which his ID. My goal is to get this result: 0 0x1A00000F AAAAAAAAAAA ...
jms2505's user avatar
  • 68
1 vote
1 answer
84 views

I am currently working on some Python code that will be executed by a larger C# web project. The C# code uses NLog to create log files. I have got my Python logger logging to the same file. Also, I ...
ysi_d's user avatar
  • 71
0 votes
0 answers
71 views

I have created a custom style for Labels in my application, this works fine and I apply a Template to achieve the other set styles that I need, again this works fine. STYLE DEFINITIONS: <Style ...
Richard Gale's user avatar
  • 1,952
0 votes
1 answer
85 views

I know this is likely a duplicate question and for that I am sorry. I have been looking for a way to format a custom string, that is pulling values from SQL database. I have read many S.O. on ...
Primdonm's user avatar
-2 votes
1 answer
62 views

in C# I use the string.Format() function to get an output like this: Of course, the problem is caused by the \t in this line: string.Format("{0}\t\t{1}\t\t{2}...) I tried various string.Format() ...
user2711923's user avatar
0 votes
1 answer
905 views

I am looking for a solution that is the most convenient for casual, exploratory notebook use. I have several functions that output strings with multiple lines. When this appears in the output cell of ...
escapecharacter's user avatar
1 vote
1 answer
108 views

Here is a simplied rule for my problem rule test: output: output_tex = expand("TPA_{region}.tex", region = [0,1]), shell: """ for((i=0;i<2;i+...
RedQuark's user avatar
2 votes
3 answers
2k views

I have a snippet where I generate a string that includes an original number (original_number) and its corresponding Roman numeral (roman_number). I want to format this string so that the original ...
aarondn's user avatar
  • 21
3 votes
2 answers
258 views

I have the following Java code that increases the value of a hex value and returns a string using the following format (where x is an increasing hex value and 7 is a literal): xxxx-7xxx-xxxx The ...
Joe D's user avatar
  • 144
0 votes
1 answer
143 views

Here I have a code for a function that creates a formatted table.It currently works but I want to optimise it considering "Setting an item of incompatible dtype is deprecated and will raise an ...
okijuh123's user avatar
-1 votes
1 answer
155 views

I am trying to make a seemingly simple piece of code that I am unable to get working. It takes a double (or float) and formats it to a string in a specific way: E.g. 13.453.123,25 (Dots for thousands, ...
OADINC's user avatar
  • 35
0 votes
1 answer
633 views

I need a label to show a number in the range of thousands. I'm not using thousand separator as per requested, but I want the user to be able to focus on the thousands. For example if I were to show &...
Dean Thomas's user avatar
1 vote
1 answer
66 views

I'm Trying to set datagridview and datarow cell format when editing and after editing from datatable in vb.net. Is it possible for the Price column to still use string.empty after editing so it ...
roy's user avatar
  • 729
0 votes
3 answers
712 views

a=str(141528231211101319151414.0) print(a) # 1.4152823121110133e+23 This string was printed with scientific notation. I do not understand why. I am using mpmath to deal with arithmetic operations ...
user409's user avatar
  • 125
0 votes
3 answers
202 views

I have a long f-string with containing many float values, all of which I want to round to the same number of digits. Is there a way to do this in one go or in a smart way, or do I need to specify the ...
db_'s user avatar
  • 653
0 votes
1 answer
152 views

I'd like to format a float so that it has at most 3 fractional digits, but if the last fractional digit(s) are 0 then omit them. input : expected output 1.1234 : 1.123 1.120 : 1.12 1.100 : 1.1 1.0 : 1 ...
Gavriel's user avatar
  • 19.3k
-2 votes
1 answer
101 views

Is it possible to make something to set StringFormat of Binding property for all (or part of) TextBoxes in project? Yes, I can write something like <TextBox x:Name="SetPosition" Style=&...
Fedor Yudin's user avatar
3 votes
2 answers
265 views

I am searching Splunk using powershell via API and get a list of data that contain dates (not in DateTime format). The API call is performed by a Function that works fine and it works for the inital ...
Jhowel's user avatar
  • 61
-1 votes
1 answer
212 views

Basically the function where you add a variable inside a string like the JavaScript template literals: var str = "This is a sample"; print(`So you load the string in with ${str}, and it ...
X078's user avatar
  • 25
-3 votes
1 answer
167 views

I am working in google sheets. Excel also works. I have column called "funds." This column has names of venture funds, such as Accel, A16z, and Sequoia. One fund in each row. I have another ...
pynewbee's user avatar
  • 669
1 vote
1 answer
183 views

I'm following code from a channel on YT and im given this error and cant figure out how to resolve it. This is the error ExpectedConstraintError: Invalid string format at Object.run (C:\Discord Bot\...
Jake Carpenter's user avatar
0 votes
3 answers
785 views

Context I am receiving numbers as strings in Python 3 and want to transmit them as strings in order to preserve accuracy so that the upstream server can convert the numbers-as-strings to decimal....
NeilG's user avatar
  • 4,128
-1 votes
1 answer
359 views

I'm working on a Python script where I need to format three different types of lists into a string that will be used as the body of an email. The lists are as follows: A list of strings: a = ['1.1.1.1'...
Rogers's user avatar
  • 15
0 votes
1 answer
129 views

I have been working though Fluent Python 2nd Edition by Luciano Ramalho. On page 5 he writes that he has attempted to adopt the f string syntax throughout the book, although there are times when str....
caseycronyn's user avatar
0 votes
0 answers
53 views

I made a R-script and build several html tables with kablExtra. I made 4 tables. I forgot to make a header for the 3th. So I tried to make a header for the third with this code: #### Set GLOBAL ...
jord seegers's user avatar
0 votes
2 answers
583 views

I have a series of numbers that can be either large integers, or very small decimals. I would like numbers with more than four digits to be displayed in scientific notation. At first, I considered a ...
Matthew Fournier's user avatar
3 votes
1 answer
3k views

I'm testing migrating a .NET 6.0 application to .NET 8.0, and the following piece of code now throws CA1863 "Use 'CompositeFormat'". But I don't know how. private const string ...
PMF's user avatar
  • 17.7k
1 vote
1 answer
131 views

I am looking at other code on a Java practice. Here is his code: import java.util.Arrays; import java.util.stream.Collectors; public class StripComments { public static String stripComments(...
RockBottom1114's user avatar
1 vote
1 answer
91 views

I recently wrote a small program where I'm trying to convert a number of seconds into a more human readable format, but I'm having problems when trying to format the output and somehow I end up ...
Jerry Jones's user avatar
-1 votes
1 answer
189 views

I am new to python and trying to learn the basic just learned how to format string today and couldn't figure out what is wrong with this line of codes data = ["Zac", "poor fella", ...
Zack's user avatar
  • 3

1
2 3 4 5
87