in reply to Re: floating point validation
in thread floating point validation
#!/usr/bin/perl use strict; use warnings; my $val = 101.24; validate( 3, 2, $val ); sub validate { my $v1 = $_[0]; my $v2 = $_[1]; my $v3 = $_[2]; print "Values are $v1 \t $v2 \t $v3 \n"; if ( $v3 =~ m/^\d{$v1}\.\d{$v2}$/ ) { print "its a good one\n"; } else { print "Not Good!!"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: floating point validation
by Your Mother (Archbishop) on Aug 30, 2010 at 16:43 UTC |