Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sprintf format

Status
Not open for further replies.

kevin197

Programmer
Mar 21, 2002
88
GB
I'm trying to get my price like 99.99 to have spaces at the front to pad it out to 10 bits.

I tryed this

$netprice0 = sprintf ('%10d.%2f',$netprice0);

But get
99.0.000000

I'm after " 99.99"

Can anyone help?
 
Done it :)

$netprice0 = sprintf ('%10.2f',$netprice0);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top