Comma separator not handled in Create form number input

Expected behavior

While creating an object, filling number input using comma separator should store the right decimal values. Eg: Filling “0,5” should result in storing 0.5 in database.

Actual behavior

On object creation, number input filled with comma , separator is not handled, and result in storing only integer part. Eg: filling in 0,5 will store 0.

Worth noticing that this is working as expected in Edit form, which is supporting both separators , and ..

Failure Logs

Forest comma sep


Please provide any relevant information about your setup.

  • Package Version: forest-express-sequelize@8.2.2
  • Express Version: 4.17.1
  • Sequelize Version: 5.15.2
  • Database Dialect: PG
  • Database Version: 11
  • Project Name: Shotgun Admin

Hello @Lucas_Gerard,

Thanks for your message! :raised_hands:

I just tried to reproduce (with version 8.2.7 of forest-express-sequelize) but with no success :thinking:
It is actually creating the new record with the decimal number.

Could you please tell me what is the type of your minimum fee field is your model? And in your database?
And please show me the payload of the request sent when creating the new record?


Hello @adriguy, this is a float8, but actually I’ve managed to pin down the issue: this is related to the defaultValue: 0 option in Sequelize model:

By removing this option, there is indeed no issue.

Is that something you could fix on your side?

Thank you!

Well @Lucas_Gerard, that’s very well spotted! :raised_hands:
I can reproduce the issue on my hand.

I’ve created a bug report so that it can be fixed in the near future.