archux Posted May 30, 2008 Report Share Posted May 30, 2008 (edited) Sveiki! Kā var no db selektot šādu: ieraksts: Cena = '0.2' , man vajag lai rāda 0.20, bet ja tiek ierakstīts šādi: Cena = '0.21' tad rāda 0.21! id Cena 1 0.2 => Jārāda 0.20 2 0.21 => kārāda 0.21 Ceru, ka sapratāt! Paldies jau iepriekš! Edited May 30, 2008 by archux Link to comment Share on other sites More sharing options...
andrisp Posted May 30, 2008 Report Share Posted May 30, 2008 Varianti: 1. Glabaat mysql puse kaa DECIMAL(10,2) . Nebuus jaauztraucas par apaljoshanu, 0iiti galaa arii pats pieliks. 10 vietaa vari izveeleeties citu ciparu. Skaties manuaalii.. 2. Izdrukaajot izmanto php money_format() funkciju. 3. Shito neesmu meegjinaajis, bet vareetu straadaat - ja gribi, lai tas viss notiek mysql pusee, bet nedriiksti mainiit lauka tipu, tad vari meegjinaat izmanto CONVERT funkciju un konverteet uz to pashu DECIMAL(10,2). Negalvoju, ka tas ko sarakstiiju, straadaas. :] Link to comment Share on other sites More sharing options...
cilveks Posted May 30, 2008 Report Share Posted May 30, 2008 http://dev.mysql.com/doc/refman/5.0/en/mat...-functions.html Link to comment Share on other sites More sharing options...
marcis Posted May 31, 2008 Report Share Posted May 31, 2008 Es parasti izmantoju DOUBLE(8,2). Un izvadot apreķinus number_format(); Link to comment Share on other sites More sharing options...
archux Posted June 2, 2008 Author Report Share Posted June 2, 2008 viss ok tiku galā paldies! Link to comment Share on other sites More sharing options...
Recommended Posts