🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
# 组件源码 ``` /** * <b>方法描述:</b> 元转换为分 <br/> * <b>创建者:</b> admin <br/> * <b>创建时间:</b> 2020-12-16 10:14:30 <br/> * * @param inamt * 入参|输入金额|{@link java.lang.Object} * @param outamt * 出参|输出金额|{@link java.lang.String} * @return 0 失败<br/> * 1 成功<br/> */ @Component(label = "元转换为分", style = "处理型", type = "同步组件", comment = "将金额转换成分为单位,支持千分符格式输入,规则:输入转为数字后,乘以100", version = "1.0.0", deprecated = false, author = "admin", date = "2020-12-16 10:14:30") @InParams(param = {@Param(name = "inamt", comment = "输入金额", type = java.lang.Object.class)}) @OutParams(param = {@Param(name = "outamt", comment = "输出金额", type = java.lang.String.class)}) @Returns(returns = {@Return(id = "0", desp = "失败"), @Return(id = "1", desp = "成功")}) @Order(value = 2) public static ResultBase P_amtToFen(Object inamt) { BigDecimal d = transform(inamt); if (d == null) return ResultBase.newFailureResult("TPTA0002", "输入不是合法金额数据,输入数据:" + inamt); d = d.multiply(new BigDecimal(100)).setScale(0); return ResultBase.newSuccessResult(d.toString()); } ``` # 交易中组件使用方式 ![](https://img.kancloud.cn/47/ff/47ff94bd5d121868864fc1bf7f745399_1865x863.png) # 参数说明及示例 ## 入口参数 输入金额:传入一个数值型参数,示例: `100` ## 出口参数 输出金额:把输入金额乘以100后返回,示例: `__INNER__["fen"]`