开发者

Accepting values containing multiple point system

开发者 https://www.devze.com 2023-02-20 21:22 出处:网络
How do i accept values from user that contain multiple points like 1.2.1...if i use float--1.2.1 gets con开发者_如何转开发verted to 1.2.

How do i accept values from user that contain multiple points like 1.2.1...if i use float--1.2.1 gets con开发者_如何转开发verted to 1.2.

Thanks.


the simple answer: if u want multiple points DONT USE FLOAT :-)

use something like varchar or text instead


Treat it as text.

A float is used to represent Real numbers, and "1.2.1" is not a Real number.

Or, if "1.2.1" is simply a grouping of numbers, you could split the input of "1.2.1" into three separate numbers using the period as a delimiter, and store them as distinct numbers.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号