gstring icon indicating copy to clipboard operation
gstring copied to clipboard

gstring Format problem

Open doublejulien opened this issue 9 years ago • 2 comments

Hi!

I found an issue with gstring.Format and i can't format the way i want

void Update() { using (gstring.Block()) { timeElapsed += Time.deltaTime; ts = TimeSpan.FromSeconds(timeElapsed); myText.text = gstring.Format("{0:D2}:{1:D2}:{2:000}", ts.Minutes, ts.Seconds, ts.Milliseconds).Intern(); } }

The logger throwing the current exception ----> InvalidOperationException: Couldn't find close brace for argument 0

Except that part, its incredible the gain of Garbage i have compared to my previous code! Btw, is my pseudo code the correct way of using gstring? Can i use gstring on mobile?

Regards,

J

doublejulien avatar May 26 '16 08:05 doublejulien

Date format is not supported. gstring.Format only supports simple formatting with {0}, {1}, etc. Feel free to add the feature and make a pull request if you want :)

vexe avatar May 27 '16 04:05 vexe

Haha thanks but i doubt i have the competence to do that unfortunately :(

doublejulien avatar May 27 '16 07:05 doublejulien