Tyke 发表于 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.

hardwired 发表于 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..
页: 1 [2]
查看完整版本: VBA: Number formatting