• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Fixed Big price gives a mysql error

CyberAP

Well-known member
#1
Just enter a value of about 100000000000000000 USD and get a mysql error:
Mysqli statement execute error : Incorrect decimal value: '1.0E+199' for column 'price' at row 1.
Probably the price field should say that price value is limited by some amount.
 

Chris D

XenForo developer
Staff member
#4
The GDP of the USA????

Other than on April fools day, is anyone really going to need to enter a value larger than 10 digits?

View attachment 70837
I agree it's unlikely, but equally it's very easy to prevent by setting a maxValue in the DataWriter for that field; or some other validation that doesn't allow it to exceed that value.
 

whynot

Well-known member
#5
And by the way sometimes you might need to use these high numbers for example if you choose to show price in belarusian rubles. :)


Yes, for countries with high inflation rate.
Millions: 999,000,000 = 9 digits
Billions: 999,000,000,000= 12 digits
Trillions: 15 digits

Multiply that 15 digits: 99 digits
Still another 100 to go to reach 1.0E+199

Could that inflation go over 99? I don't think so.
 

CyberAP

Well-known member
#6
Millions: 999,000,000 = 9 digits
Billions: 999,000,000,000= 12 digits
Trillions: 15 digits

Multiply that 15 digits: 99 digits
Still another 100 to go to reach 1.0E+199

Could that inflation go over 99? I don't think so.
The maximum price XenForo accepts is 99,999,999.99.
 

CyberAP

Well-known member
#8
Then some variables don't match.
99,999,999.99 rounded down : 99,999,999 > 9.9E+7
I don't get what you're trying to say :)
You can't enter a value there that is higher than 99,999,999.99. And there is no field indication that this value is limited by that amount. Also I think the limit should be increased to 1 billion, but that goes to a technical side.
 
#10
And by the way sometimes you might need to use these high numbers for example if you choose to show price in belarusian rubles. :)


Yes, for countries with high inflation rate.
Realistically, websites based in countries undergoing hyperinflation list things for sale in other currencies - USD or EUR, usually.
There's at least one big Vietnamese XF forum though isn't there, and the Dong is 20,000 to the USD, so that ten million limit would be worth about $5,000 to them. Still a whole heck of a lot for a resource, but not unimaginable, so maybe an extra decimal place or two would be handy - or a floating point, or something.