It should be relatively straightforward to implement an override of this function to behave as you require.
The plugin code is almost trivial in what it does. Take a copy of it from wherever you have it installed and make it part of your code-base, so your version is the one that will be found during compilation, i.e.
Myapp/lib/Template/Plugin/Number/Format.pm
edit it thus:
-use Number::Format;
+use Number::Format::NoZeroCents;
Then add a new module to your code:
Myapp/lib/Number/Format/NoZeroCents.pm;
that looks like this:
package Number::Format::NoZeroCents;
use strict;
use warnings;
use base 'Number::Format';
sub format_price {
my $self = shift;
my ($number, $precision, $symbol) = @_;
if(defined $precision){ #default behaviour
printf STDERR "%s: default behaviour for %s\n", __PACKAGE__, join(';',@_);
return $self->SUPER::format_price(@_)
}
else {
$precision = 0 if $number == int($number);
printf STDERR "%s: override behaviour for %s\n", __PACKAGE__, $number;
return $self->SUPER::format_price($number, $precision, $symbol)
}
}
1;
And that should mean your NoZeroCents approach is used by default throughout your code, but you can override by calling [% number | format_price(2) %]
when you want $100.00 to appear.
UPDATE
Number::Format definitely does the right thing when told to use precision => 0, as this quick test confirms:
#!/usr/bin/env perl
use strict;
use warnings;
use Number::Format qw(format_price);
my $v = 100.00;
printf "Original value as string '%s'; as number '%f'; as fp '%s'; as fp0: '%s'\n",
$v, $v, format_price($v), format_price($v,0);
which produces:
Original value as string '100'; as number '100.000000'; as fp 'AUD 100.00'; as fp0: 'AUD 100'