Accepting values containing multiple point system
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.
精彩评论