DEV Community

Discussion on: How to handle a price with Ruby-on-Rails

Collapse
 
songta17 profile image
Vorachith Phoubandith

Thanks ! Small precision that we need to know when we use this advice: during the model creation and depending of the need, we can adapt the first digit :

  • price:decimal{3,2} # value between. -9.99 and 9.99
  • price:decimal{4,2} # value between. -99.99 and 99.99
  • price:decimal{5,2} # value between. -999.99 and 999.99 etc.