本文整理汇总了TypeScript中shared/utils/numericUtils.toNumberOrUndefined函数的典型用法代码示例。如果您正苦于以下问题:TypeScript toNumberOrUndefined函数的具体用法?TypeScript toNumberOrUndefined怎么用?TypeScript toNumberOrUndefined使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了toNumberOrUndefined函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: fromObject
static fromObject (value?: any): HowMuchDoYouOwe {
if (!value) {
return value
}
const amount = toNumberOrUndefined(value.amount)
const totalAmount = toNumberOrUndefined(value.totalAmount)
return new HowMuchDoYouOwe(amount, totalAmount)
}
示例2: fromObject
static fromObject (value?: any): NumberOfChildren {
if (!value) {
return value
}
return new NumberOfChildren(
toNumberOrUndefined(value.under11),
toNumberOrUndefined(value.between11and15),
toNumberOrUndefined(value.between16and19)
)
}
示例3: deserialize
deserialize (input?: any): OtherWitnesses {
if (input) {
this.otherWitnesses = YesNoOption.fromObject(input.otherWitnesses)
if (input.otherWitnesses) {
this.howMany = toNumberOrUndefined(input.howMany)
}
}
return this
}
示例4: fromObject
static fromObject (value?: any): OtherWitnesses {
if (!value) {
return value
}
return new OtherWitnesses(
YesNoOption.fromObject(value.otherWitnesses),
toNumberOrUndefined(value.howMany))
}
示例5: fromObject
static fromObject (value?: any): HowMuchOwed {
if (value) {
const amount = toNumberOrUndefined(value.amount)
const text = value.text
return new HowMuchOwed(amount, text)
} else {
return new HowMuchOwed()
}
}
示例6: deserialize
public deserialize (input: any): CountyCourtJudgment {
if (input) {
if (input.defendantDateOfBirth) {
this.defendantDateOfBirth = MomentFactory.parse(input.defendantDateOfBirth)
}
this.paymentOption = input.paymentOption
this.paidAmount = toNumberOrUndefined(input.paidAmount)
this.repaymentPlan = input.repaymentPlan ? new RepaymentPlan().deserialize(input.repaymentPlan) : undefined
this.payBySetDate = input.payBySetDate ? MomentFactory.parse(input.payBySetDate) : undefined
this.statementOfTruth = new StatementOfTruth().deserialize(input.statementOfTruth)
if (input.ccjType) {
this.ccjType = input.ccjType
}
}
return this
}
示例7: it
it('given "1,110,100" ', () => {
expect(toNumberOrUndefined('1,110,100')).to.be.eq(1110100)
})