Skip to content

Commit 7dc486d

Browse files
committed
add NumericSpec.exponentChar
1 parent 6f54b2f commit 7dc486d

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

source/mir/bignum/decimal.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ struct Decimal(size_t maxSize64)
408408

409409
// prints e+/-exponent
410410
auto expLength = printSignedToTail(exponent, buffer0[$ - N - 16 .. $ - 16], '+');
411-
buffer[$ - ++expLength] = 'e';
411+
buffer[$ - ++expLength] = spec.exponentChar;
412412
w.put(buffer[$ - expLength .. $]);
413413
}
414414

source/mir/format.d

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@ struct NumericSpec
208208
///
209209
Format format;
210210

211+
/// Defaults to 'e'
212+
char exponentChar = 'e';
213+
211214
/++
212215
Precise output with explicit exponent.
213216
Examples: `1e-6`, `6e6`, `1.23456789e-100`.

0 commit comments

Comments
 (0)