Skip to content

Commit

Permalink
Round the temperatures with int()
Browse files Browse the repository at this point in the history
  • Loading branch information
voegelas committed Sep 30, 2022
1 parent 60234cf commit f8c21d5
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 6 deletions.
1 change: 0 additions & 1 deletion META.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"requires" : {
"Exporter" : "0",
"File::Spec" : "0",
"Math::BigFloat" : "0",
"Mojo::Base" : "0",
"Mojo::Collection" : "0",
"Mojo::Date" : "0",
Expand Down
2 changes: 0 additions & 2 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ my %WriteMakefileArgs = (
"PREREQ_PM" => {
"Exporter" => 0,
"File::Spec" => 0,
"Math::BigFloat" => 0,
"Mojo::Base" => 0,
"Mojo::Collection" => 0,
"Mojo::Date" => 0,
Expand Down Expand Up @@ -55,7 +54,6 @@ my %WriteMakefileArgs = (
my %FallbackPrereqs = (
"Exporter" => 0,
"File::Spec" => 0,
"Math::BigFloat" => 0,
"Mojo::Base" => 0,
"Mojo::Collection" => 0,
"Mojo::Date" => 0,
Expand Down
1 change: 0 additions & 1 deletion cpanfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

requires "Exporter" => "0";
requires "File::Spec" => "0";
requires "Math::BigFloat" => "0";
requires "Mojo::Base" => "0";
requires "Mojo::Collection" => "0";
requires "Mojo::Date" => "0";
Expand Down
3 changes: 1 addition & 2 deletions lib/MyApp/Weather/Plugin/Helpers.pm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use Mojo::Base 'Mojolicious::Plugin', -signatures;

our $VERSION = '0.004';

use Math::BigFloat;
use MyApp::Weather::View::Messages qw(gettext);

sub register ($self, $app, $conf) {
Expand All @@ -17,7 +16,7 @@ sub register ($self, $app, $conf) {
}

sub _make_round ($scale = -1) {
return sub ($num) { Math::BigFloat->new($num)->bfround($scale)->numify };
return sub ($num) { int $num + ($num > 0 ? 0.5 : -0.5) };
}

sub _make_format_temperature ($unit, $scale = -1) {
Expand Down

0 comments on commit f8c21d5

Please sign in to comment.