docs: document float property (for v2.1.2) (#10575)
This commit is contained in:
@@ -69,10 +69,49 @@ export default MyCustom
|
||||
|
||||
---
|
||||
|
||||
## float
|
||||
|
||||
<Note>
|
||||
|
||||
This property is only available after [Medusa v2.1.2](https://github.com/medusajs/medusa/releases/tag/v2.1.2).
|
||||
|
||||
</Note>
|
||||
|
||||
The `float` method defines a number property that allows for values with decimal places.
|
||||
|
||||
<Note title="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](#bignumber).
|
||||
|
||||
</Note>
|
||||
|
||||
For example:
|
||||
|
||||
export const floatHighlights = [["4", "float", "Define a `float` property."]]
|
||||
|
||||
```ts highlights={floatHighlights}
|
||||
import { model } from "@medusajs/framework/utils"
|
||||
|
||||
const MyCustom = model.define("my_custom", {
|
||||
rating: model.float(),
|
||||
// ...
|
||||
})
|
||||
|
||||
export default MyCustom
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## bigNumber
|
||||
|
||||
The `bigNumber` method defines a number property that expects large numbers, such as prices.
|
||||
|
||||
<Note title="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](#float).
|
||||
|
||||
</Note>
|
||||
|
||||
For example:
|
||||
|
||||
export const bigNumberHighlights = [["4", "bigNumber", "Define a `bigNumber` property."]]
|
||||
|
||||
Reference in New Issue
Block a user