Re: sprintf(): different output on Windows and Linux

new topic     » goto parent     » topic index » view thread      » older message » newer message

Julio C. Galaret Viera wrote:
> sprintf("%03s", {"62"})
> 
> on Windows: "062"
> on Linux:   " 62" (a blank space instead of zero)
> 
> Why? It's supposed to produce the same output on both, isn't it?

The "leading zeros" feature of printf/sprintf is really meant
for numeric data, not strings, so I guess the C printf() library
routines that Euphoria depends on, are not compatible in 
this unusual case.

If you do:
   sprintf("%03d", 62)
they both give:
   "062"

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu