[Newbies] Number formatting printf/sprintf for Squeak?

Sorensen sorens at surfy.net
Tue Feb 17 03:15:34 UTC 2009


Thanks everybody for your replies.  I'll look at SBE and Seaside 2.9 as well
for further examples. 

> For left-justifying text, I'm a bit surprised that you'd want to do this.
> Typically, you'd make the text left
> or right justified in whatever GUI element that value ends up in, rather
> than padding it with spaces.

You're right.  I'd like to do more than simply left-justify:

   "%6.2f"      34.56     "space-padded right justified"
   "%-6.2f"  34.56        "space-padded left justified"
   "%02d"    05            "zero padded left justified"

etc

Your examples though gave me a good place to start.

Many thanks


Sorensen wrote:
> 
> Is there a printf/sprintf-like package for formatting text  for Squeak?
> 
> If not, how do Squeakers go about formatting currency amounts or left
> justifying text within a field?
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Number-formatting-printf-sprintf-for-Squeak--tp22045889p22049206.html
Sent from the Squeak - Beginners mailing list archive at Nabble.com.



More information about the Beginners mailing list