Len()函数的数字不返回预期结果 [英] Len() function for number not returning expected results

查看:177
本文介绍了Len()函数的数字不返回预期结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是对一个数字使用了Len()函数,它返回了一些古怪的结果。例如,当我执行Len(1)时,它返回4.如果我在数字周围加上引号,则它正确返回。任何想法?

I just used the Len() function on a number and it returned some wacky result. For example, when I did Len(1), it returned 4. If I put quotes around the number, then it returned correctly. Any ideas?

推荐答案

len()函数返回两个值之一:1)字符串的长度,或2)读取所需的字节数变量。

The len() function returns one of two values: 1) The length of a string, or 2) the number of bytes necessary to read the variable.

展开 | 选择 | Wrap | < span class =codeLinkonclick =LineNumbers(this);>行号


我知道LenB()函数返回了字节数,但我没有我不知道Len()函数会对数字做同样的事情。根据Google上的不同搜索,似乎其他人已经能够在查询中使用Len()函数来获取数字中的位数,但也许这是因为它是SQL而不是VBA,这是我正在使用的是什么。
I knew that the LenB() function returned the number of bytes, but I didn''t know that the Len() function would do the same on numbers. Based on different searches on Google, it seems like others have been able to use the Len() function in queries to be able to get the number of digits in a number, but maybe that is because it is SQL and not VBA, which is what I''m using.


据我所知,在VB / VBA中你不能使用Len()函数来获取整数的长度。您必须将整数转换为字符串。
As far as I know in VB/VBA you cannot use the Len() function to get the length of an integer. You would have to convert the integer to a string.


这篇关于Len()函数的数字不返回预期结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆