yeahz Posted August 11, 2009 Report Share Posted August 11, 2009 Zinu ka pastāv tāda lieta kā $mainiigais++, bet ko darīt ja $mainiigais sākas ar 0.1 un es gribu lai viņš turpinās kā - 0.2, 0.3, 0.4..., ja izmanto ++ tad pieskaita uzreiz veselu 1. Quote Link to comment Share on other sites More sharing options...
xPtv45z Posted August 11, 2009 Report Share Posted August 11, 2009 $mainiigais+=0.1 Quote Link to comment Share on other sites More sharing options...
Aleksejs Posted August 11, 2009 Report Share Posted August 11, 2009 Un neviens arī nav atcēlis: $mainigais = $mainigais + 0.1; :) Quote Link to comment Share on other sites More sharing options...
yeahz Posted August 11, 2009 Author Report Share Posted August 11, 2009 Un kādu tipu izvēlēties datubāzē, lai varētu ar komatu? Quote Link to comment Share on other sites More sharing options...
bubu Posted August 11, 2009 Report Share Posted August 11, 2009 Naudai (un citām mērvienībām, kurai ciparu precizitāte aiz komata ir svarīga) - NUMERIC Citiem (performances vajadzībām) - FLOAT vai DOUBLE. Quote Link to comment Share on other sites More sharing options...
yeahz Posted August 14, 2009 Author Report Share Posted August 14, 2009 Kāpēc man nav tāda NUMERIC? Quote Link to comment Share on other sites More sharing options...
bubu Posted August 14, 2009 Report Share Posted August 14, 2009 Kā tas ir - "tev nav" ? MySQL dokumentācijā gan ir: http://dev.mysql.com/doc/refman/5.1/en/numeric-types.html Quote Link to comment Share on other sites More sharing options...
yeahz Posted August 14, 2009 Author Report Share Posted August 14, 2009 Nu tur kur ir visi tipi, gan FLOAT, gan DOUBLE, tur nav atrodams tāds NUMERIC. Quote Link to comment Share on other sites More sharing options...
bubu Posted August 14, 2009 Report Share Posted August 14, 2009 Kas tas ir - "tur kur ir visi tipi" ? Reku tev iedevu linku no MySQL dokumentācijas, kur ir visi datu tipi, kurus tas saprot. Un tur ir NUMERIC (aka DECIMAL). 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.