把价钱转化为xx.xx的形式
把number类型转化为字符串类型
let orderPayFeeStr = this.state.orderPayFee.toString();//商品价格转化为字符串
if(orderPayFeeStr.indexOf(".") != -1){
orderPayFeepointBefore = orderPayFeeStr.split(".")[0];
orderPayFeepointAfter = orderPayFeeStr.split(".")[1].length == 1?orderPayFeeStr.split(".")[1]+"0":orderPayFeeStr.split(".")[1];
}else{
orderPayFeepointBefore = orderPayFeeStr;
orderPayFeepointAfter = "00";
}
以上是react框架中用
把价钱转化为xx.xx的形式的更多相关文章
- com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK assets/com.xx.xx
完整的Error 信息(关键部分) Error:Execution failed for task ':fanwe_o2o_47_mgxz_dingzhi:transformResourcesWith ...
- 解决:eclipse删除工程会弹出一个对话框提示“[project_name]”contains resources that are not in sync with"[workspace_name...\xx\..xx\..\xx]"
提示“[project_name]”contains resources that are not in sync with"[workspace_name...\xx\..xx\..\xx ...
- sharepoint:找不到位于 http://XX.XX.XX.XX 的 Web
自己写了个sharepoint的webservice,发不到IIS上后报错: System.IO.FileNotFoundException: 找不到位于 http://XX.XX.XX.XX 的 W ...
- Could not create pool connection. The DBMS driver exception was: null, message from server: "Host '192.168.XX.XX' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'
早上打开浏览器准备登陆某个系统,发现Error 404--Not Found,有点奇怪,这个服务器应该没人用了才对,然后到weblogic后台去看日志,报如下错误: "Could not c ...
- HTTPConnectionPool(host='xx.xx.xx.xx', port=xx): Max retries exceeded with url:(Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x0000015A25025EB8>...))
HTTPConnectionPool(host='xx.xx.xx.xx', port=xx): Max retries exceeded with url:(Caused by ConnectTim ...
- c# mac地址 和http://xx.xx.xx/ 正则表达式匹配
Mac :^([0-9a-fA-F]{2})(([/\s:][0-9a-fA-F]{2}){5})$ C# 书写方式 一下是允许mac中间间隔符是“:”或者“-”两种输入方式 并且我把上边的正则表达 ...
- (WF, Debug) System.Xaml.XamlObjectWriterException: Cannot create unknown type '{clr-namespace:xx;assembly=xx}xx'.
Load WF 后一开始运行的时候就发现 System.Xaml.XamlObjectWriterException: Cannot create unknown type '{clr-namespa ...
- com.android.tools.build:gradle:X.XX.XX:gradle.jar 插件无法下载问题
在使用Android Studio 这个IDE时,出现com.android.tools.build:gradle:X.XX.XX:gradle.jar 插件无法下载问题 可能的原因就是网速不好或者依 ...
- 关于“xx.xx已被OS X使用,无法打开”的问题
Mac电脑上的文件拷贝到移动硬盘,有时候会出现“xx.xx已被OS X使用,无法打开”的问题. 解决办法: 1.打开终端(或在Mac搜索里面输入Terminal); 2.在终端里输入 xattr -l ...
- Navicat 连接远程数据库报错:1130 - Host "XX.XX.XX.XX" is not allowed to connect to this MySQL server
Navicat 连接远程数据库报错:1130 - Host "XX.XX.XX.XX" is not allowed to connect to this MySQL server ...
随机推荐
- Python timedelta
datetime.timedelta对象代表两个时间之间的的时间差,两个date或datetime对象相减时可以返回一个timedelta对象. 构造函数: class datetime.time ...
- 两个线程与stringbuffer和stringbuiler以及lock synchronized线程测试
import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; public clas ...
- 菜鸟夜谈android反编译
工具: apktool:https://code.google.com/p/android-apktool/ dex2jar: https://code.google.com/p/dex2jar/ j ...
- BZOJ4602 Sdoi2016 齿轮 【带权并查集】*
BZOJ4602 Sdoi2016 齿轮 Description 现有一个传动系统,包含了N个组合齿轮和M个链条.每一个链条连接了两个组合齿轮u和v,并提供了一个传动比x : y.即如果只考虑这两个组 ...
- HDU2473 Junk-Mail Filter 【可删除的并查集】
HDU2473 Junk-Mail Filter Problem Description Recognizing junk mails is a tough task. The method used ...
- Unity下XLua方案的各值类型GC优化深度剖析
转自:http://gad.qq.com/article/detail/25645 前言 Unity下的C#GC Alloc(下面简称gc)是个大问题,而嵌入一个动态类型的Lua后,它们之间的交互很容 ...
- 《DSP using MATLAB》示例Example 8.20
%% ------------------------------------------------------------------------ %% Output Info about thi ...
- python面试题(十)
Python中基本数据结构的操作 元组 列表 字典 集合 定义 新增 更改 删除 2.请尽可能列举python列表的成员方法,并给出一下列表操作的答案: (1)a=[1, 2, 3, 4, 5], a ...
- 关于fpga优化的set input delay 和 set output delay
set input delay 和set output delay 首先必须明确的是指的外部delay,而非input或output的内部delay,那么这外部delay包含什么呢?包含1,外部路径延 ...
- matplotlib ----- 同一线条的不同颜色
对同一线条的各个段或者特殊点, 用不同的颜色. 参考下面 http://stackoverflow.com/questions/30121773/python-is-it-possible-to-c ...