KillerBean Posted August 19, 2006 Report Share Posted August 19, 2006 gribeeju apvaicaaties, vai kaads nevareetu pateikt, ar kaadu magjisku funkciju to var izdariit.. (pielikt 2 ciparus aiz komata. piem. ja ir 2, tad lai buutu 2.00; vai ja ir 5.7, lai buutu 5.70) jo nezinu peec kaa mekleet.. :( Link to comment Share on other sites More sharing options...
Vebers Posted August 19, 2006 Report Share Posted August 19, 2006 ar strpos paskaties vai ir punkts skaitlii, ja ir tad ar strlen izskaiti cik ciparu aiz komata un attiecigi tik ari pievieno. Ja nav ciparu aiz komata, tad pievieno 2 nulles. Link to comment Share on other sites More sharing options...
PheliX Posted August 19, 2006 Report Share Posted August 19, 2006 http://lv.php.net/manual/en/function.number-format.php Link to comment Share on other sites More sharing options...
bubu Posted August 19, 2006 Report Share Posted August 19, 2006 MakaTaNaw.. tev laikam čerez ž.. visu vajag darīt :) Jālieto vai nu number_format, kā jau PheliX saka, vai arī var ar sprintf, kā darītu rūdīti C programmētāji: $str = sprintf("%.2f", $num); Link to comment Share on other sites More sharing options...
Delfins Posted August 19, 2006 Report Share Posted August 19, 2006 ja jau nauda, tad labāk number_format.. kas noformatē arī veselo daļu.. vismaz smukāk un saprotamāk uzreiz cipars tiek uztverts Link to comment Share on other sites More sharing options...
Recommended Posts