[TIMOB-18640] String.Format truncates text after %d
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | n/a |
Labels | n/a |
Reporter | Bert Grantges |
Assignee | Unknown |
Created | 2015-03-05T19:43:00.000+0000 |
Updated | 2018-02-28T19:54:49.000+0000 |
Description
When using String.Format(), if you include a number any remaining characters will be removed from the final output.
In your Titanium App:
var forename = 'Paul';
var number = 21;
var message = String.format('Welcome, %s! You are visitor number %d', forename, number);
console.log(message);
Notice that this outputs as expected:
Welcome, Paul! You are visitor number 21
Now try the same code except this time add some additional text after you use the %d
var forename = 'Paul';
var number = 21;
var message = String.format('Welcome, %s! You are visitor number %d isn't that great!?', forename, number);
console.log(message);
Then take a look at the output -
Welcome, Paul! You are visitor number 21
Notice that the remaining text content is removed.
Can someone give us any hints about an upcoming fix (or not)?
[~jonalter] is this related to the fix you did recently?