Note: This property is only available after Medusa v2.1.2.
The float method defines a number property that allows for values with decimal places.
Tip: Use this property type when it's less important to have high precision for numbers with large decimal places. Alternatively, for higher percision, use the bigNumber property.
For example:
Code
1import{ model }from"@medusajs/framework/utils"23const MyCustom = model.define("my_custom",{4 rating: model.float(),5// ...6})78exportdefault MyCustom
The bigNumber method defines a number property that expects large numbers, such as prices.
Tip: Use this property type when it's important to have high precision for numbers with large decimal places. Alternatively, for less percision, use the float property.
For example:
Code
1import{ model }from"@medusajs/framework/utils"23const MyCustom = model.define("my_custom",{4 price: model.bigNumber(),5// ...6})78exportdefault MyCustom