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!?!


Reply


4 Posts   1501 Views

Avatar
kcd

Community Member, 54 Posts

25 March 2009 at 5:31pm

Edited: 25/03/2009 5:33pm

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?

Avatar
kcd

Community Member, 54 Posts

7 April 2009 at 2:08pm

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

Avatar
Hamish

Community Member, 712 Posts

7 April 2009 at 8:37pm

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.

Avatar
kcd

Community Member, 54 Posts

17 April 2009 at 4:44pm

[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.

Anyone??