我想知道数字是十进制还是整数 [英] I want to know whether a digit is decimal or int

查看:89
本文介绍了我想知道数字是十进制还是整数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

我想知道数字是十进制还是int

我知道在前端我们可以使用indexof方法,但如何在后端做ti

该字段的数据类型为十进制,但某些行包含1.00,另一些行包含1.50,以区分这些字段

Hi all

I want to know whether a digit is decimal or int

i know in front end we can use indexof method but how to do ti in back end

datatype for the field is decimal but some rows contains 1.00 and others 1.50 i wnat to distinguish those fields

if(DayTotal.IndexOf('0') >0)
{
   1.5
}
else
{
   1.00
}



如何在后端制作

在此先感谢



how to make it in back end

Thanks in advance

推荐答案

我肯定有很多方法.我举一个使用CHARINDEXCASE
的示例
I''m sure many ways there. I give you an example using CHARINDEX with CASE
SELECT '123.45'
,CASE
WHEN CHARINDEX('.','123.45') > 0
THEN 'Decimal'
WHEN CHARINDEX('.','123.45') = 0
THEN 'Integer'
END AS ValueType


这篇关于我想知道数字是十进制还是整数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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