lizard Posted May 18, 2007 Report Share Posted May 18, 2007 Sveiki, Tāda lūk lieta, ir rezultāts, cipari, kas ir summa santīmos, un man vajag uzlikt ta lai rāda latos, respektīvi, ir 357, bet vajag lai rāda 3,57. Kā var 2 ciparus no beigām ievietot skaitlī komatu Link to comment Share on other sites More sharing options...
andrisp Posted May 18, 2007 Report Share Posted May 18, 2007 <?php $x = 357; echo substr($x, 0, -2).','.substr($x, -2, 2); ?> Link to comment Share on other sites More sharing options...
bubu Posted May 18, 2007 Report Share Posted May 18, 2007 Ar stringiem operēt nav ērti.. <?php $x = 357; echo number_format($x/100, 2, ',', ''); ?> Link to comment Share on other sites More sharing options...
Recommended Posts