问题标签 [isnumeric]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
casting - 在 Teradata 中安全地将 VARCHAR 转换为 DECIMAL
在 Teradata DB 我有源表
该表加载了来自外部系统的数据。我有目标表
我需要安全地将行从 SRC_TABLE 复制到 DST_TABLE。有一个合同,外部系统将只提供可转换为 DECIMAL(4) 的值。但是,是否有任何安全的方法可以选择 SRC_TABLE 中不符合合同并可能导致类型转换失败的行?
更新:由于我工作环境的限制,我无法使用 UDF 函数。
php - Difficulty checking if elements in array are type integer PHP
I am trying to detect if one or more variables contain numbers. I have tried a few different methods, but I have not been entirely successful.
Here is what I have tried.
I haven't been successful using this method. Any ideas? Thankyou in advance!
sql-server - T-sql - 确定值是否为整数
我想确定一个值是否为整数(如TryParse
在.NET 中)。不幸ISNUMERIC
的是不适合我,因为我只想解析整数而不是每种数字。有没有这样的ISINT
东西?
这是一些使事情变得清晰的代码。如果MY_FIELD
不是 int,则此代码将失败:
谢谢
php - is_numeric($str) 用于数据库查询
基本上我的问题是,如果我有一个数字字符串,并且我要将它与数据库进行比较,这是一种安全/安全的检查方式。或者我应该只是逃避我的数字变量以及我的字符串(就像我已经做的那样)?
例子:
sql - Varchar 到数字的转换 - CLR 或 'e0'
我想将 Varchar 列中的数据转换为数字数据类型 -
所以在转换之前我调用 ISNUMERIC 函数来检查数据是否为数字,如果是则将其转换为数字数据类型。但我面临一个问题 -
IsNumeric 函数的行为不符合预期 -
它在以下 SQL 的帮助下进行了解释-
我用谷歌搜索并找到了解决这个问题的各种解决方案 -
在上述情况下推荐的解决方案是什么?为什么?
另外,如果有人能解释为什么 IsNumeric(x) 返回 false - 当 varchar 值只有制表符而没有逗号时,我将不胜感激?
谢谢!
asp-classic - 经典的 ASP IsNumeric 怪异?
刚刚遇到了一个相当奇怪的功能,其中内置的 IsNumeric 函数是经典的 ASP。
我有一个 JSONArray 类,可以将其内容打印到字符串中 - 它IsNumeric
用于确定是否使用"
's 转义值。一切正常,直到今天客户报告了一个以前看不见的错误!
经过一番挖掘,我发现从 AJAX 调用返回的 JSON 数组中的一些记录格式不正确。更多挖掘。原来格式类似于的字符串'2D25'
将被评估为数字IsNumeric
,因此不会被转义!
有人知道为什么吗?ASP 是否认为D
可以与 a 互换.
?
另外,我应该如何解决这个问题?正则表达式会是更好的解决方案吗?
谢谢!
vb.net - 在循环中使用 IsNumeric 函数提高性能,该函数在 VB.net 中执行 1 比 1 caror 或更多
我有一个用 VB.net 编写的函数,代码如下所示。
nRow = 210 nCols = 64772
在上面的代码中,第一次循环执行需要 4 到 5 分钟,我进行了研究并观察到,然后由于 IsNumeric 函数需要更多时间,对此不确定。
任何人都可以知道代码的哪一部分导致性能问题。请分享你的想法。
谢谢,穆罕默德萨迪克。
.net - IsNumeric equivalent in Linq
I need to use a function in Linq that equivalent to IsNumeric function in SQL. What I am trying to do is get codes that matches a common pattern. The codes should be unique and they are generated by code. The pattern is like this:
ABCD0000001 ABCD0000002 ...
But then user can manuplate the code and enter any character in anywhere in generated code (of course then I check the uniqueness of the code afterwards, but that is out of interest). So the records in database can be
ABCD0000001 ABCD00000T01 ABCDT0000002 ..and so on.
What I want is getting the last programmatically generated (not manipulated by user) codes and retrieve the last numeric digits, so that I can add it by 1 resulting in unique code. (So the last autogenerated code is ABCD0007865 then the new code should be ABCD0007866)
I tried
but this code throws an exception saying NotSupportedException: Method 'Boolean TryParse(System.String, Int32 ByRef)' has no supported translation to SQL."
What should I do? Is my way too complicated? Is there a smarter way? Thanks in advance.
asp-classic - IsNumeric 函数无法正常工作
经典asp失败中的IsNumeric函数有一个非常奇怪的问题。我的代码中发生了这样的事情:
有没有人知道为什么会发生这种情况?
在规范中,据说这些函数适用于可以转换为数字的字符串,从上面的示例中您可以看到我得到“真实”的结果。但是什么会导致我的问题?
vb.net - 验证文本框
我正在使用 Windows 窗体做一个简单的应用程序,我有一个问题......
我的表单有 15 个文本框,我想使用事件 KeyPress 或验证来验证每个人。我有这个工作的代码:
但是我有 15 个文本框(可能更多),并且在每个文本框事件中都有点单调地复制/粘贴此代码。你能教我用一个函数来做到这一点吗?
我正在寻找正确的方法来做到这一点?
英语是我的第二语言,我也在学习编程。