summaryrefslogtreecommitdiff
path: root/FS/FS/Record.pm
diff options
context:
space:
mode:
Diffstat (limited to 'FS/FS/Record.pm')
-rw-r--r--FS/FS/Record.pm17
1 files changed, 17 insertions, 0 deletions
diff --git a/FS/FS/Record.pm b/FS/FS/Record.pm
index ba03091..08811a2 100644
--- a/FS/FS/Record.pm
+++ b/FS/FS/Record.pm
@@ -1308,6 +1308,23 @@ sub ut_floatn {
$self->setfield($field,$1);
'';
}
+=item ut_floatn COLUMN
+
+Check/untaint floating point numeric data: 1.1, 1, 1.1e10, 1e10. May be
+null. If there is an error, returns the error, otherwise returns false.
+
+=cut
+
+#false laziness w/ut_ipn
+sub ut_floatn {
+ my( $self, $field ) = @_;
+ if ( $self->getfield($field) =~ /^()$/ ) {
+ $self->setfield($field,'');
+ '';
+ } else {
+ $self->ut_float($field);
+ }
+}
=item ut_snumber COLUMN