Questions tagged [formatted]
95 questions
59
votes
7 answers
Nicely formatting output to console, specifying number of tabs
I am generating a script that is outputting information to the console. The information is some kind of statistic with a value. So much like a hash.
So one value's name may be 8 characters long and another is 3. when I am looping through outputting…
user130532
36
votes
7 answers
node and express send json formatted
I'm trying to send formatted json with express.
Here is my code:
var app = express();
app.get('/', function (req, res) {
users.find({}).toArray(function(err, results){
// I have try both
res.send(JSON.stringify(results, null, 4));
//…

BoumTAC
- 3,531
- 6
- 32
- 44
21
votes
4 answers
The easiest way to read formatted input in C++?
Is there any way to read a formatted string like this, for example :48754+7812=Abcs.
Let's say I have three stringz X,Y and Z, and I want
X = 48754
Y = 7812
Z = Abcs
The size of the two numbers and the length of the string may vary, so I dont want…

Loers Antario
- 1,611
- 6
- 20
- 24
13
votes
2 answers
What's the difference between String.format() and str.formatted() in Java?
I know that method String.format() is nearly the same as method System.out.printf() except it returns a String. But I could hardly find the introduction about method "formatted" which is defined as follows:
public String formatted(Object... args) {
…

NormalLLer
- 183
- 2
- 11
10
votes
4 answers
Android strings.xml resource - arabic language and dynamic formatted strings
Hello I have a question about arabic formatting how should I properly format this strings, it seems i can't manage this:
تحميل %1$s…
تم تحميل الكلمات. %1$d/%2$d!
This is in sublime text 2 - but i think that there is Left-to-Right…

Michał Ziobro
- 10,759
- 11
- 88
- 143
9
votes
1 answer
Create a computed observable for formatted values for a bunch of variables
I have 3 observable variables in view-model, and want to output to formatted value. However, I don't want to write computed method for each of them since they are identical. What is the best way to reuse the code? Thanks.
The code I am going to…

Gary Zi
- 95
- 1
- 6
7
votes
3 answers
Formatting output with printf: truncating or padding
I would like to produce the following output:
> Avril Stewart 99 54
> Sally Kinghorn 170 60
> John Young 195 120
> Yutte Schim... 250 40
As you can see, names shorter than 14 characters are padded with spaces. Names longer than 15 characters…

Dave Smith
- 97
- 1
- 2
- 6
5
votes
3 answers
C# How can I paste formatted text from clipboard to the RichTextBox
I added context menu to the richboxtext with only one function "paste". What code will paste my clipboard content (e.g. copied from Microsoft Word) to the richboxtext form? I tried with:
private void PasteToolStripMenuItem_Click_1(object sender,…

user1188235
- 55
- 1
- 1
- 4
5
votes
1 answer
Usage of this next_combination code
Currently I am trying to generate combinations from a vector that contains some integers. For now I want it to print out all of the combinations that are of length to_generate.
I found this code at combination and permutation in C++ that uses…

shuttle87
- 15,466
- 11
- 77
- 106
5
votes
3 answers
Formatted printing in Java
I have this code:
public String toString(Day day)
{
String s = day.getDayName() + " " + day.toString();
return s;
}
This is Day class's toString method:
public String toString()
{
String s = "";
for (Slot slot: slots)
s…

bobby
- 51
- 1
- 2
4
votes
2 answers
Write statement cannot produce new lines within user-defined formatted I/O procedures for derived type
I want to implement the user-defined I/O procedures for the derived types in my Fortran code. However, write statements within those procedures cannot produce new lines between two sequential write statements. The derived type and procedures are…

Rubin
- 332
- 1
- 10
4
votes
1 answer
Improve Fortran formatted I/O with a large number of small files
Lets assume I have the following requirements for writing monitor files from a simulation:
A large number of individual files has to be written, typically in the order of 10000
The files must be human-readable, i.e. formatted I/O
Periodically, a…

MechEng
- 360
- 1
- 13
4
votes
0 answers
jquery geocomplete formatted address and street number
I'm using this jQuery script:
http://ubilabs.github.io/geocomplete/
When autocompletion is done, the formatted address will include the street number or not, depending on the user input but both entries will generate a success result.
Is it possible…

Baylock
- 1,246
- 4
- 25
- 49
4
votes
3 answers
iPhone: Problems with Formatted String (Objective C)
I need help.
How come this does not work:
NSProcessInfo *process = [NSProcessInfo processInfo];
NSString *processName = [process processName];
int processId = [process processIdentifier];
NSString *processString = [NSString…

Devoted
- 177,705
- 43
- 90
- 110
3
votes
0 answers
How to preserve formatting when using getText() method in Google Docs using App Script / Javascript
The code below pulls in text from a file. I want to pull all the text from this file, and the text from this source file is formatted in bullet points.
var autoPay = DocumentApp.openById("[file ID]");
autoPay_text =…

Rifica
- 31
- 2