Add parse float API

This commit is contained in:
iliajie
2022-10-28 22:35:57 +03:00
parent 9f2ef4c91a
commit 87c8146698
2 changed files with 14 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@@ -12299,6 +12299,19 @@ if ( $currentcertfile =~ /$defaultcertname$/ &&
return 0;
}
# float(number)
# Parses float number and returns it or returns 0 if cannot
sub float
{
my ($number) = @_;
my $float = sprintf('%.2f', $number);
if ($float == 0.00) {
return 0;
}
return $float;
}
$done_web_lib_funcs = 1;
1;