完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
大家好;自90年代以来,我一直在使用Vee。
Vee一直有一个错误让我无法忍受悲伤。 出于某种原因,一些real64或real32号码似乎无法理解。 我很确定它与浮点数有关.. yada yada,但我不明白为什么当我将数字转换为显示的文本值时,它仍然无法正确显示它。采用real64数字 95.96这个数字出现在95.9599999999999999这真的弄乱了我的报告和显示。 我可以处理它的唯一两种方法是将其转换为文本并截断它使数字高于95.95(这不是我真正想要的数字)或者我必须打破它的数字Int和fractional,乘以小数 100,绕过它,除以100,然后将它们转换为文本,然后将文本重新连接起来。我想我只是想知道为什么多年来这个问题没有得到解决。 并且,如果还有其他方法有更简单的解决方法吗?。这是Vee Pro 9Real Number Bug Example.vee中的一个例子 以上来自于谷歌翻译 以下为原文 Hello All; I have been using Vee off and on since the 90's. There has always been a bug in Vee that has caused me no end of grief. For some reason, some real64 or real32 numbers vee just can't seem to understand. I am pretty sure it has to do with floating point.. yada yada, but what I don't understand is why when I convert the number to a text value for display, it still can't display it correctly. Take the real64 number 95.96 This numer shows up in vee as 95.9599999999999999 This really messes up my reports and displays. The only 2 ways I can deal with it is to either turn it to text and truncate it which make the number above 95.95 (which is not the number I really want) or I have to break the number it Int and fractional, multiply the fractional by 100, round it, divide by 100 then turn them to text then concantonate the text back together. I guess I was just wonder why this hasn't been fixed in the many years. And, if any else has an easier workaround?. Here is an example in Vee Pro 9 Real Number Bug Example.vee 附件 |
|
相关推荐
2个回答
|
|
试试这个....添加一个公式,然后键入System.Convert.ToString(x)这应该可以解决问题。***编辑***顺便说一句,你必须去设备,.Net程序集参考,
并将mscorlib获取到Selected References.Then,导入System.Text名称空间,以使此工作.... 以上来自于谷歌翻译 以下为原文 Try this.... Add a formula, then type in System.Convert.ToString(x) That should do the trick. ***EDIT*** By the way, you have to go to Device, .Net Assembly Reference, and get the mscorlib to the Selected References. Then, import System.Text name space, in order to make this work.... |
|
|
|
添加一个ToString就可以了。它可以得到完全相同的结果。
=)希望附加的vee文件有帮助。 以上来自于谷歌翻译 以下为原文 Add a ToString will do. It get exactly same result as you want. =) Hope attached vee file helps. 附件
|
|
|
|
只有小组成员才能发言,加入小组>>
1230 浏览 0 评论
2351 浏览 1 评论
2160 浏览 1 评论
2026 浏览 5 评论
2908 浏览 3 评论
974浏览 1评论
关于Keysight x1149 Boundary Scan Analyzer
707浏览 0评论
N5230C用“CALC:MARK:BWID?”获取Bwid,Cent,Q,Loss失败,请问大佬们怎么解决呀
808浏览 0评论
1230浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-26 02:59 , Processed in 1.309177 second(s), Total 82, Slave 63 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号