Skip to content
This repository was archived by the owner on Apr 24, 2023. It is now read-only.

Commit 8aad321

Browse files
committed
Fix DecimalFormat
1 parent 789432b commit 8aad321

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

UOL_PagSeguro-2.7.0.tgz

5 Bytes
Binary file not shown.

lib/PagSeguroLibrary/helper/PagSeguroHelper.class.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ public static function formatDate($date)
5151
public static function decimalFormat($value)
5252
{
5353
if (is_float($value)) {
54-
$value = (float) $value;
55-
$value = floor($value * 100) / 100;
56-
$value = (string) number_format($value, 2, '.', '');
54+
if (strcspn(strrev($value), '.') >= 3) {
55+
$value = floor($value * 100) / 100;
56+
}
5757
}
58-
return $value;
58+
return (string)number_format($value, 2, '.', '');
5959
}
6060

6161
/***

0 commit comments

Comments
 (0)