JSON标准 - 浮点数 [英] JSON standard - floating point numbers

查看:545
本文介绍了JSON标准 - 浮点数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 result:{base_fee是一个有效的JSON表示法, :1e-005} 

或者指数表示法应该用十进制表示法替换吗?

解决方案

这是根据 json.org ,因为数字可以有一个以E,大写或小写,可选加号或减号和一个或多个数字表示的基数10指数。


I am wondering whether the following floating point notation is a valid JSON notation:

"result":{"base_fee":1e-005}

or should the exponent notation be replaced with a decimal notation?

解决方案

It is valid according to the format available at json.org as numbers can optionally have a base 10 exponent denoted by an E, uppercase or lowercase, an optional plus or minus, and one or more digits.

这篇关于JSON标准 - 浮点数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆