dAivEd Posted February 26, 2009 Report Share Posted February 26, 2009 Nu piemēram ir 100 santīmi, ka lai parāda ka tas ir 1.00 Ls, un piemēram ka 1000 santīmi ir 10.00 Ls? Kautkāda funkcija bija lidzīga explode(); Quote Link to comment Share on other sites More sharing options...
codez Posted February 26, 2009 Report Share Posted February 26, 2009 Izmanto http://lv.php.net/number_format: number_format($santimi/100, 2, ',', ' '); Quote Link to comment Share on other sites More sharing options...
dAivEd Posted February 26, 2009 Author Report Share Posted February 26, 2009 Varēja arī kautkā datubāze ierakstīt VARCHAR 3,4 vai kautkas tāds kad automatiski ieliek punktu piem 3.4000 Quote Link to comment Share on other sites More sharing options...
Aleksejs Posted February 26, 2009 Report Share Posted February 26, 2009 MySQLā ir DECIMAL datu tips, kas ir domāts tieši naudas lietām. Quote Link to comment Share on other sites More sharing options...
Grey_Wolf Posted February 27, 2009 Report Share Posted February 27, 2009 Nu piemēram ir 100 santīmi, ka lai parāda ka tas ir 1.00 Ls, Taa ir 2 klasites matimatika !!! Un nevajag nekadas uberkrutas funkcijas.. santimus izdali ar 100 un ieguusi Latus + noapaljo un izvadi ar funkciju number_format(); P.S. Ka tu veikalaa norekinies?? Jebshu dari kaa vecas tantinjas (kas slikti redz) iedod pardevejai kaudzi ar naudu lai pati panjem cik vajag.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.