Venom Posted February 22, 2005 Report Posted February 22, 2005 es ceru ka šis bija joks vai no ātras rakstīšanas echo "formatsize($sum)"; reizināt ar 100, lai pēc tam izdalītu ar 100? hm...
bubu Posted February 22, 2005 Report Posted February 22, 2005 (edited) Lynx: Šito round($file_size / 1048576 * 100) / 100 var uzrakstīt daaaudz smukāk: round($file_size/(1>>20), 2); :) Edit: Venom, viš gribēja 2 ciparus aiz komata atstāt :) Edited February 22, 2005 by bubu
bubu Posted February 22, 2005 Report Posted February 22, 2005 1 Mb=1024 Kb1 Kb=1024 b round($sizeinbytes/1024^2,1) 14067[/snapback] emm, Venom, vai tad ^ nav xor?
Lynx Posted February 22, 2005 Report Posted February 22, 2005 O, Paldies Bubu. Un jaa, gribeju 2us ciparus aiz komata tapec taa.
Venom Posted February 22, 2005 Report Posted February 22, 2005 emm, Venom, vai tad ^ nav xor? viss, es zināju, ka ar tādām galvassāpēm kodēt jēgas nav. aiziet LJ
Venom Posted February 22, 2005 Report Posted February 22, 2005 Un jaa, gribeju 2us ciparus aiz komata tapec taa. atgādināja kā es Javā kko tādu raxtīju (: viss oki
bubu Posted February 22, 2005 Report Posted February 22, 2005 Es ar šitā rasktīju iekš qbasic'a kautkad sen sen :)
рпр Posted February 22, 2005 Report Posted February 22, 2005 vajag izmantot sprintf formateetiem stringiem.
bubu Posted February 22, 2005 Report Posted February 22, 2005 vajag izmantot sprintf formateetiem stringiem. 14078[/snapback] qbasic'ā nav sprintf :))
Recommended Posts