Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Data Model Questions

No decimal places on my host, no matter what!?!


4 Posts   1436 Views


25 March 2009 at 5:31pm (Last edited: 25 March 2009 5:33pm), Community Member, 54 Posts

Argh I can't work this one out. It started with my currencies rounding to the nearest dollar but the plot thickens... My local copy works fine so I actually think this is a php set up issue or something. I have non-currency fields are rounding, i get no decimal places

decimal(2,2), currency and even currency(3,2) always come out as decimal(x,0) on my host!

e.g. Currency(3,0) outputs these when running db/build

# Field MenuItem.Price: changed to decimal(3) not null (from decimal(3,0) not null)
# Field MenuItem_Live.Price: changed to decimal(3) not null (from decimal(3,0) not null)
# Field MenuItem_versions.Price: changed to decimal(3) not null (from decimal(3,0) not null)

Any ideas?


7 April 2009 at 2:08pm Community Member, 54 Posts

The MySQL expert at my hosting company had no idea. If the error is with Silverstripe where could I check it?


7 April 2009 at 8:37pm Community Member, 712 Posts

adding ?showqueries=1 to your will tell you what sql is being run, then you can try it from phpMyAdmin to see if the sql is correct.


17 April 2009 at 4:44pm Community Member, 54 Posts

[url]?showqueries=1 didn't show me anything so perhaps this isn't how i'm supposed to use it.

Still no success on this error. Everyone seems to be at a loss to what could be causing it. I will probably have to give up and use text fields for all numbers.