本文整理匯總了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)
})