PHP will easily display a value with trailing zeros - you don't add '00' programmatically.
eg: $number = number_format(1234, 2, '.', ''); On Thu, Dec 1, 2016 at 8:08 AM, Werner Kleiner <sqlitetes...@gmail.com> wrote: > As I can see storing prices is a topic with different ways and > different solutions. > > The advice to store prices in Cent or Integer: > Yes you can do: but how will you sore hundredth cents amounts or tenth > cent prices? > I have prices like 0,0020 or 0,0008 Euro > > I think I have to manipulate the prices for viewing in the app with PHP. > Fact is: we can have to DBs MySQL and SQlite. MySQL with decimal(7,4) > stores a price 1.500 from a textfield exact so. > If you want to show the price again in the app, there is nothing to do. > But switching to SQLite the price is viewed as 1.5 (and stored) > I know this is no error of SQLite. But I have now to differ between > Sqlite and MySQL and have to optimize the SELECT and adding 00 > programmatically to view correct if using Sqlite. > > My original post was if there is a way for both DBs with same > behavior, but it seems not. > > Thanks to all for help. > > Werner > > > > > > _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users