meteor-astronomy
meteor-astronomy copied to clipboard
Feature: mongo Deciamal type
To save monetary field, mongo 3.4 has supported NumberDecimal type, and meteor has its package mongo-decimal, which uses the npm package decimal.js, and SimpleSchema supports it by allowing you use Decimal
as field type.
If/How Astronomy supports decimal?
+1
how about this?
how about this?
I don't have time to implement it. If any one wants to help, feel free to create PR
thanks for your reply. sorry I have abit knowledge
@zhaoyao91, @thearabbit try this:
import { Type } from 'meteor/jagi:astronomy'
Type.create {
name: 'Decimal'
class: Decimal
cast: (value) ->
Decimal(value.toString())
validate: (args) ->
Decimal.isDecimal(args)
}