added support for float numbers
git-svn-id: http://galileo.dmi.unict.it/svn/relational/trunk@34 014f5005-505e-4b48-8d0a-63407b615a7cmaster
parent
a340186071
commit
ee37a74088
@ -0,0 +1,28 @@
|
||||
# Relational
|
||||
# Copyright (C) 2008 Salvo "LtWorf" Tomaselli
|
||||
#
|
||||
# Relation is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# author Salvo "LtWorf" Tomaselli <tiposchi@tiscali.it>
|
||||
|
||||
'''Custom types for relational algebra'''
|
||||
class rstring (str):
|
||||
'''String subclass with some custom methods'''
|
||||
def isFloat(self):
|
||||
'''True if the string is a float number, false otherwise'''
|
||||
lst=['0','1','2','3','4','5','6','7','8','9','.']
|
||||
for i in self:
|
||||
if i not in lst:
|
||||
return False;
|
||||
return True;
|
@ -1,9 +1,9 @@
|
||||
id name chief age
|
||||
0 jack 0 22
|
||||
0 jack 0 22.1
|
||||
1 carl 0 20
|
||||
2 john 1 30
|
||||
3 dean 1 33
|
||||
4 eve 0 25
|
||||
5 duncan 4 30
|
||||
6 paul 4 30
|
||||
7 alia 1 28
|
||||
7 alia 1 28
|
||||
|
Loading…
Reference in New Issue