diff options
Diffstat (limited to 'crates/shirabe-php-src/src')
| -rw-r--r-- | crates/shirabe-php-src/src/main/snprintf.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/shirabe-php-src/src/main/snprintf.rs b/crates/shirabe-php-src/src/main/snprintf.rs index f1411d6e..c0a3f23a 100644 --- a/crates/shirabe-php-src/src/main/snprintf.rs +++ b/crates/shirabe-php-src/src/main/snprintf.rs @@ -6,9 +6,13 @@ /// produces the same digit string as `zend_dtoa` in mode 0 (both compute the unique shortest /// decimal that round-trips), so only the digit placement logic is ported here. pub fn php_gcvt(value: f64, ndigit: i32, dec_point: char, exponent: char) -> String { + assert!(ndigit == -1); + assert!(dec_point == '.'); + assert!(exponent == 'E'); + let mode = if ndigit >= 0 { 2 } else { 0 }; if mode != 0 { - todo!("php_gcvt is only ported for ndigit < 0 (serialize_precision=-1)"); + unreachable!("php_gcvt is only ported for ndigit < 0 (serialize_precision=-1)"); } let ndigit = 17i32; |
