乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
楼主: hardwired

VBA: Number formatting

[复制链接]

29

主题

519

帖子

477

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
163
发表于 2022-7-6 23:24:46 | 显示全部楼层
We sometimes get a conflict here as the decimal seperator on a German language OS is by default a comma and some software will only work properly when its set to a "."
I don't honestly believe it is your problem here, but its worth a look.
 
Have you tried running your program on another machine? Try to find out if its machine specific or code specific.
 
As an aside, I had exactly this problem in 2007 when I wrote some VBA code and used the "0.##0" to get round the problem. Yesterday I ran the same code on a new W7 x64 machine with AutoCAD 2013 and replaced "0.##0" with "0.000" and it worked fine! It looks to be more Machine specific than anything else. After I got that result I tested on anther XP Pro x86 running AutoCAD 2010 and "0.000" worked fine there too.
回复

使用道具 举报

46

主题

118

帖子

23

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
291
发表于 2022-7-6 23:27:18 | 显示全部楼层
Hey all, after being booted off this site for apparently sending an advert post, I'm back
 
I managed to sort my number formatting / decimal place issue with a little bit of cheating though I'm afraid. I simply converted the value to a string variable then formatted it. Its fine for what I needed but obviously not the correct way but needs must I guess..
 
Thanks for all your help guys and if you find a reason why mine didn't work before, please let me know and I'll do likewise..
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-12 23:07 , Processed in 0.417456 second(s), 54 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表