@@ -45,26 +45,26 @@ public static function toSeconds(string $duration, ?string $format = 'l') : floa
4545
4646 public static function toMinute (string $ duration , ?string $ format = 'l ' ) : float
4747 {
48- return self ::toSeconds ($ duration , $ format ) / 60 ;
48+ return round ( self ::toSeconds ($ duration , $ format ) / 60 , 2 ) ;
4949 }
5050
5151 public static function toHour (string $ duration , ?string $ format = 'l ' ) : float
5252 {
53- return self ::toMinute ($ duration , $ format ) / 60 ;
53+ return round ( self ::toMinute ($ duration , $ format ) / 60 , 2 ) ;
5454 }
5555
5656 public static function toDay (string $ duration , ?string $ format = 'l ' ) : float
5757 {
58- return self ::toHour ($ duration , $ format ) / 24 ;
58+ return round ( self ::toHour ($ duration , $ format ) / 24 , 2 ) ;
5959 }
6060
6161 public static function toMonth (string $ duration , ?string $ format = 'l ' ) : float
6262 {
63- return round (self ::toDay ($ duration , $ format ) / 30 , 2 );
63+ return round (self ::toDay ($ duration , $ format ) / 30 , 1 );
6464 }
6565
6666 public static function toYear (string $ duration , ?string $ format = 'l ' ) : float
6767 {
68- return round (self ::toDay ($ duration , $ format ) / 365 , 2 );
68+ return round (self ::toDay ($ duration , $ format ) / 365 , 1 );
6969 }
7070}
0 commit comments