本文整理汇总了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)
}
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:10,代码来源:howMuchDoYouOwe.ts
示例2: fromObject
static fromObject (value?: any): NumberOfChildren {
if (!value) {
return value
}
return new NumberOfChildren(
toNumberOrUndefined(value.under11),
toNumberOrUndefined(value.between11and15),
toNumberOrUndefined(value.between16and19)
)
}
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:11,代码来源:numberOfChildren.ts
示例3: deserialize
deserialize (input?: any): OtherWitnesses {
if (input) {
this.otherWitnesses = YesNoOption.fromObject(input.otherWitnesses)
if (input.otherWitnesses) {
this.howMany = toNumberOrUndefined(input.howMany)
}
}
return this
}
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:9,代码来源:otherWitnesses.ts
示例4: fromObject
static fromObject (value?: any): OtherWitnesses {
if (!value) {
return value
}
return new OtherWitnesses(
YesNoOption.fromObject(value.otherWitnesses),
toNumberOrUndefined(value.howMany))
}
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:9,代码来源:otherWitnesses.ts
示例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()
}
}
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:9,代码来源:howMuchOwed.ts
示例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
}
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:16,代码来源:countyCourtJudgment.ts
示例7: it
it('given "1,110,100" ', () => {
expect(toNumberOrUndefined('1,110,100')).to.be.eq(1110100)
})
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:3,代码来源:numericUtils.ts
注:本文中的shared/utils/numericUtils.toNumberOrUndefined函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论