Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » problem with Format
Re: problem with Format [message #36142 is a reply to message #36141] Thu, 03 May 2012 19:58 Go to previous message
mirek is currently offline  mirek
Messages: 14267
Registered: November 2005
Ultimate Member
nixnixnix wrote on Thu, 03 May 2012 12:08

Hi,

I want to print a double with one decimal place like

57.2m Speed

so naturally I use

String s = Format("%.1fm Speed",height);

and this usually works. However, just now my program complains that it can't find the fm format specifier.

For now I will have to leave a space between but really I think it should recognise the f and ignore the m.



Well, actually, it would work in release mode only, by nasty trick to maintain backward compatibility with printf.

Thing is, if we want to have Format extensible, and we do, we need to have a little bit different rules (like eat all the id).

Anyway, what you are looking for is ` escape character:


String s = Format("%.1f`m Speed",height);
 
Read Message
Read Message
Previous Topic: Problem with "Time" type in XML strings
Next Topic: Read CSV Line (Solved)
Goto Forum:
  


Current Time: Mon Sep 01 21:05:04 CEST 2025

Total time taken to generate the page: 0.05341 seconds