This commit is contained in:
mynah
2020-01-15 23:42:58 -06:00
parent 567e991278
commit 252ec865b3
33 changed files with 1556 additions and 238 deletions

View File

@@ -2,7 +2,7 @@ package Dojo::Support;
use strict;
use warnings;
use Exporter 'import';
our @EXPORT = qw/ log dmph merge_hash load_module get_names /;
our @EXPORT = qw/ commify month_num2txt log dmph merge_hash load_module get_names /;
use Mojo::Base 'Mojolicious';
use File::Basename;
@@ -39,6 +39,17 @@ sub merge_hash{
}
return $h;
}
sub month_num2txt{
return ("enero febrero marzo abril mayo junio julio agosto septiembre octubre noviembre diciembre" =~ m/\w+/g)[shift (@_) -1];
}
#put comas on price numbers
sub commify {
my $text = reverse $_[0];
$text =~ s/(\d\d\d)(?=\d)(?!\d*\.)/$1,/g;
return scalar reverse $text;
}
sub load_module{
my $dir=shift;