How to print floats with leading blanks instead of leading zeros using sprintf?
- From: Валерий Симонов <valerasimonov@xxxxxxxxx>
- Date: Mon, 28 May 2012 08:09:25 -0700 (PDT)
Hi everyone,
I want to specify labels for the plots using sprintf.
According to http://www.cplusplus.com/reference/clibrary/cstdio/sprintf/
sprintf(' %3.0f',1) should print "001"
sprintf(' %3.0d',1) should print " 1".
However gnuplot outputs:
sprintf(' %3.0f',1) "001"
sprintf(' %3.0d',1) "1" (without leading blanks).
Does anyone know how to fix this issue?
Thanks in advance!
Regards,
Valera
.
- Follow-Ups:
- Re: How to print floats with leading blanks instead of leading zeros using sprintf?
- From: Christoph Bersch
- Re: How to print floats with leading blanks instead of leading zeros using sprintf?
- From: Hans-Bernhard Bröker
- Re: How to print floats with leading blanks instead of leading zeros using sprintf?
- From: sfeam
- Re: How to print floats with leading blanks instead of leading zeros using sprintf?
- Prev by Date: is it possible to plot a 2d parametric equation with more than one parameter?
- Next by Date: Re: How to print floats with leading blanks instead of leading zeros using sprintf?
- Previous by thread: is it possible to plot a 2d parametric equation with more than one parameter?
- Next by thread: Re: How to print floats with leading blanks instead of leading zeros using sprintf?
- Index(es):
Relevant Pages
|