Finishing off CSV import functionality

This commit is contained in:
Tom Bloor 2017-11-15 18:22:49 +00:00
parent 423c68aca2
commit 91677034ca
6 changed files with 149 additions and 31 deletions

View file

@ -0,0 +1,17 @@
package Pear::LocalLoop::Plugin::Currency;
use Mojo::Base 'Mojolicious::Plugin';
sub register {
my ( $plugin, $app, $cong ) = @_;
$app->helper( parse_currency => sub {
my ( $c, $currency_string ) = @_;
my $value;
if ( $currency_string =~ /^£([\d.]+)/ ) {
$value = $1 * 1;
}
return $value;
});
}
1;