切换侧边栏
Blog
没写
4 Tasks to complete
Software Update
65%
Hardware Upgrade
35%
Unit Testing
15%
Bug Fixes
90%
See tasks with details
没写
8 Notifications
New Comments
+12
Bob just signed up as an editor ...
New Orders
+8
Followers
+11
See all notifications
没写
5 Messages
Alex:
Ciao sociis natoque penatibus et auctor ...
a moment ago
Susan:
Vestibulum id ligula porta felis euismod ...
20 minutes ago
Bob:
Nullam quis risus eget urna mollis ornare ...
3:15 pm
Kate:
Ciao sociis natoque eget urna mollis ornare ...
1:33 pm
Fred:
Vestibulum id penatibus et auctor ...
10:09 am
See all messages
你没
登录
主页
upload
Blog
#438EB9
#222A2D
#C6487E
#D0D0D0
选择皮肤
固定导航栏
固定侧边栏
固定面包屑
从右到左 (rtl)
里面
.container
悬停时的子菜单
紧凑型侧边栏
替代项 活动项
Arduino 将浮点数转换为字符串
2023-12-15 20:08:46
jiang
\n
楼主
在 Arduino 中使用 String() 函数将浮点数转换为字符串
要使用 String() 将浮点数转换为字符串,你需要两个参数来传递给该函数。第一个是要转换的浮点数的值,第二个是浮点数数字中存在的小数位数。
void loop() { String stringOne = String(5.698, 3); // using a float and the decimal places }
在上面的代码中,5.698 是浮点数值,3 是小数位数。你可以根据给定的浮点数来更改这些值。
取消
发送