简体   繁体   中英

How Should I use percent values in my database for a Rails app?

I am very new to Ruby on Rails, and I was looking for a way to include decimals in my database. For example, if I wanted to take a total score and and multiply it by a certain rate to get a new score. Would I use rails g model student name:string,score:integer,rate:decimal ?

Yes - you can use that to generate your model. But, could you explain in more detail what you are trying to do? The first statement "was looking for a way to include decimals in my database." - seems orthogonal to the "would i use..." question.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM