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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Data Model Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

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


Go to End


4 Posts   2289 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.