Home
Sign Up
Sign In
Advertisement
V2EX
›
Node.js
支付宝回调函数金额的判断,不知道有没有问题。
xcstream
·
Jul 10, 2018
· 4792 views
This topic created in 3050 days ago, the information mentioned may be changed or developed.
等于号左边是支付宝传来的'0.01'这样的字符串,右边是一个数字表示分
if(parseInt(parseFloat(req.body.total_fee) * 100) == amount ){
}
支付宝
tal
parsefloat
parseint
3 replies
•
2018-07-17 10:17:01 +08:00
huoru
Jul 10, 2018
1
支付宝不用分来存这么 6 的吗
xcstream
OP
Jul 11, 2018
2
parseInt 改成 Math.round 了
cqu1980
Jul 17, 2018
3
@
xcstream
parseInt 会出问题,改 Math.round 比较好,主要是经常会出现 9999 的情况。
About
·
Help
·
Advertise
·
Blog
·
API
·
FAQ
·
Privacy
·
Solana
·
5118 Online
Highest 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 31ms ·
UTC 02:40
·
PVG 10:40
·
LAX 18:40
·
JFK 21:40
♥ Do have faith in what you're doing.
❯