Comments (2)
使用Number.prototype.toFixed()方法
toFixed() 方法可以将一个数转换为字符串,保留到小数点后面指定位数的精度。但是要注意,toFixed()返回的是字符串,如果需要作为数字继续计算,需要将结果转换回数字。
+(0.1 + 0.2).toFixed(10);
+(0.1 * 0.2).toFixed(10);
+(0.3 - 0.2).toFixed(10);
from steedos-platform.
// 使用 decimal.js
Decimal.add(0.1, 0.2).toNumber(); // 结果为0.3
from steedos-platform.
Related Issues (20)
- [Bug]: space_users开启 name和 mobile加密后,保存的时候,@steedos/standard-space/main/default/triggers/space_users.trigger.js报错 HOT 1
- [Bug]: 无法建立二级组织架构
- [bug] Steedos ID 服务偶尔无法登录
- [Bug]: lookup字段配置了 相关表过滤条件 后, 在详细、列表页显示的值是 id HOT 1
- [Bug]: 应用菜单显示在左侧时, 搜索菜单下间距丢失
- [Bug]: 字段校验在列表视图编辑单个字段时不生效
- [Bug]: 记录详细页面顶部记录标题,未能识别名称字段不是name的其它名称字段
- [Bug]: 显示图标列表的lookup字段在子表table组件只读弹出窗口中报错Error: 找不到对应的渲染器
- [Bug]: 选人组件:点击部门出现错误的部门人员
- [Bug]: 对象设置页面修改字段名称后,前台不生效
- [Feature]: 作废默认的“系统信息”分组,不想显示的字段可以自己隐藏
- [Feature]: 主子表类型的相关表,包括附件,默认渲染在记录详细标签,不要放在相关标签
- [Feature]: 新建对象的默认列表视图,默认包括 name, 创建人,创建时间,并按创建时间倒序排列
- [Bug]: 布尔、开关类型字段,显示布局错误 HOT 1
- [Bug]: 新建对象时,是否显示为选项卡模式,应该放在`界面`选项卡下
- [Bug]: 对象 deploy , retrieve 之后,再次 deploy报错: Field[ instance_state ](b6_projects)中,下列字段未填写:options HOT 1
- [Bug]: 通过数据导入的用户,编辑用户信息时报错无法保存 HOT 1
- [Bug]: 记录详情页滑动滚动条,标题栏会被覆盖
- [Feature]: 应用选项卡应该支持直接在列表排序
- [Bug]: 微页面对象记录详细页面,点击“相关”后报错
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from steedos-platform.