google-apps-script - Integer always a Floating point number
问题描述
All numbers are changed to floats, with a .0
concatenated to the end.
I have tried parseInt
, toFixed
, round
, floor
and every other obvious choice.
A simple example:
Logger.log(list.length);
the log shows float values of type "Number" with a value of 5.0
for the length.
Any attempt to add numbers results in the same
for (i in [1,2,3,4,5]) {
count++;
Logger.log(count);
}
The log still shows float values
I would expect Array.length
to return an integer
解决方案
推荐阅读
- java - n 个整数扫描器的总和
- javascript - 从映射的卡片中禁用按钮 onClick
- powershell - 从调用 .exe 的 SQL 代理作业捕获错误
- identityserver4 - 如何定义这两个令牌在您的一生中重叠?
- node.js - 如何在url中传递对象数组
- r - 在 R 中,如何为我的系统发育树中的标签着色?(使用来自猿的 BioNj)
- c# - 使用 Newtonsoft 解析 json 字符串会引发 Null 引用执行
- vue.js - vuejs 不会在表单错误时滚动到 div 的顶部
- android - 为什么 dp 中的维度不是预期的?
- android - 多窗口模组的dimens.xml