How to use the DECIMAL function from sequelize
Find comprehensive JavaScript sequelize.DECIMAL code examples handpicked from public code repositorys.
239 240 241 242 243 244 245 246 247 248
key: 'Id' }, field: 'CustomerId' }, totalAmount: { type: DataTypes.DECIMAL(12,2), allowNull: true, defaultValue: 0.00, field: 'TotalAmount' },
500
0
59
+ 3 other calls in file
GitHub: maoxiaoquan/kite
112 113 114 115 116 117 118 119 120 121
type: Seq.INTEGER(6), comment: '支付类型', field: 'pay_type' }, price: { type: Seq.DECIMAL(6, 2), comment: '价格', field: 'price' }, ...time.create_date
115
516
11
34 35 36 37 38 39 40 41 42 43
exports._FLOAT0 = Sequelize.FLOAT; exports._FLOAT1 = Sequelize.FLOAT; exports._DOUBLE = Sequelize.DOUBLE; exports._DOUBLE0 = Sequelize.DOUBLE; exports._DOUBLE1 = Sequelize.DOUBLE; exports._DECIMAL = Sequelize.DECIMAL; exports._DECIMAL0 = Sequelize.DECIMAL; exports._REAL = Sequelize.REAL; exports._REAL0 = Sequelize.REAL; exports._REAL1 = Sequelize.REAL;
10
15
25
+ 19 other calls in file
12 13 14 15 16 17 18 19 20 21
name: { type: Sequelize.STRING(1024), field: 'name', }, amount: { type: Sequelize.DECIMAL(19, 4), }, quantity: { type: Sequelize.FLOAT, field: 'qty',
1
6
2
+ 3 other calls in file
218 219 220 221 222 223 224 225 226 227
}, unique: true, field: 'CustomerId' }, totalAmount: { type: DataTypes.DECIMAL(19,4), allowNull: true, defaultValue: 0, field: 'TotalAmount' }
497
0
0
10 11 12 13 14 15 16 17 18 19
}, destination: { type: Sequelize.GEOMETRY('POINT') }, price: { type: Sequelize.DECIMAL } }); module.exports = Route;
4
0
3
2 3 4 5 6 7 8 9 10 11
const { STRING, DECIMAL, INTEGER, VIRTUAL, BOOLEAN } = require('sequelize'); module.exports = db => db.define('orderItem', { price: { type: DECIMAL(10, 2), allowNull: false, validate: { min: 0 }
1
2
3
5 6 7 8 9 10 11 12 13 14
name: { type: Sequelize.STRING, allowNull: false }, price: { type: Sequelize.DECIMAL(10, 2), allowNull: false, defaultValue: 0 }, description: {
1
0
5
GitHub: saejs/sae-framework
98 99 100 101 102 103 104 105 106 107
* @param {*} opts * @returns {Object} */ number: (opts = {}) => { var ret = { type: Sequelize.DECIMAL(10, 5), allowNull: true, get(nome) { return muttations.number.get(this, nome); }
0
0
2
sequelize.col is the most popular function in sequelize (1002 examples)