Skip to content

Commit 632c551

Browse files
committed
v1.0.1
* Minor bugfixes
1 parent e32919e commit 632c551

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,11 @@ The easiest and fastest way is via our live chat on our [website](https://blockb
123123

124124
### Changelog
125125

126-
#### 1.0
126+
#### 1.0.0
127+
* Initial release.
127128

128-
- Initial release.
129+
#### 1.0.1
130+
* Minor bugfixes
129131

130132
### Upgrade Notice
131133

system/library/blockbee.php

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ public static function process_callback($_get)
212212
}
213213

214214
foreach ($params as &$val) {
215-
$val = trim($val);
215+
$val = is_string($val) ? trim($val) : null;
216216
}
217217

218218
return $params;
@@ -263,17 +263,16 @@ public static function get_estimate($coin, $api_key)
263263

264264
public static function sig_fig($value, $digits)
265265
{
266-
if ($value == 0) {
267-
$decimalPlaces = $digits - 1;
268-
} elseif ($value < 0) {
269-
$decimalPlaces = $digits - floor(log10($value * -1)) - 1;
270-
} else {
271-
$decimalPlaces = $digits - floor(log10($value)) - 1;
266+
$value = (string) $value;
267+
if (strpos($value, '.') !== false) {
268+
if ($value[0] != '-') {
269+
return bcadd($value, '0.' . str_repeat('0', $digits) . '5', $digits);
270+
}
271+
272+
return bcsub($value, '0.' . str_repeat('0', $digits) . '5', $digits);
272273
}
273274

274-
$answer = ($decimalPlaces > 0) ?
275-
number_format($value, $decimalPlaces, '.', '') : round($value, $decimalPlaces);
276-
return $answer;
275+
return $value;
277276
}
278277

279278
public static function calc_order($history, $total, $total_fiat)

0 commit comments

Comments
 (0)