mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
Add cast
This commit is contained in:
parent
3f23e6bca9
commit
5f5dc04fc2
@ -105,7 +105,7 @@ static inline void php_json_encode_double(smart_str *buf, double d, int options)
|
||||
size_t len;
|
||||
char num[PHP_JSON_DOUBLE_MAX_LENGTH];
|
||||
|
||||
php_gcvt(d, JSON_G(precision), '.', 'e', num);
|
||||
php_gcvt(d, (int)JSON_G(precision), '.', 'e', num);
|
||||
len = strlen(num);
|
||||
if (options & PHP_JSON_PRESERVE_ZERO_FRACTION && strchr(num, '.') == NULL && len < PHP_JSON_DOUBLE_MAX_LENGTH - 2) {
|
||||
num[len++] = '.';
|
||||
|
Loading…
Reference in New Issue
Block a user