On Mon, 26 Feb 2001 15:39:25 -0500, Vic Norton wrote: > $string = sprintf "%.2f\%", $x * 100; > >works fine ($string = 6.12%), but it produces an > > Invalid conversion in sprintf: end of string > >error message. Note that "%.2f\%" is exactly the same as "%.2f%" but you're on the wrong track. The escape mechanism in (s)printf templates is to double the percent sign, in order to get just one. -- Bart.
- [MacPerl] A puzzling sprintf error Vic Norton
- Re: [MacPerl] A puzzling sprintf error Paul J. Schinder
- Re: [MacPerl] A puzzling sprintf error Vic Norton
- Re: [MacPerl] A puzzling sprintf error Bart Lateur
- Re: [MacPerl] A puzzling sprintf error Chris Nandor