The Release 2.0.0 adds a ConfigurableDoubleParser to the library.
The ConfigurableDoubleParser supports parsing of double numbers in localed formats, similar to java.text.DecimalFormat.
Examples:
var symbols = NumberFormatSymbols.fromDecimalFormatSymbols(new DecimalFormatSymbols(Locale.GERMAN));
boolean ignoreCase = true;
var confdParser = new ConfigurableDoubleParser(symbols, ignoreCase);
double confD1 = confdParser.parseDouble("123.456,89e5");
double confD2 = confdParser.parseDouble("-0.15425,89E-5");
System.out.println("Double value in German Locale: " + confD1);
System.out.println("Another double value in German Locale: " + confD2);
symbols = NumberFormatSymbols.fromDecimalFormatSymbols(new DecimalFormatSymbols(Locale.forLanguageTag("zh-CN")));
symbols = symbols
.withDigits(List.of('〇', '一', '二', '三', '四', '五', '六', '七', '八', '九'))
.withExponentSeparator((Set.of("*一〇^")));
confdParser = new ConfigurableDoubleParser(symbols, ignoreCase);
double confZh = confdParser.parseDouble("四一.五七五三七一六六二一四五九八*一〇^七");
System.out.println("Double value in Chinese Locale: " + confZh);
Workaround for Zing JVM
This release contains a workaround for the Zing JVM.
Instead of calling {@link Math#unsignedMultiplyHigh(long, long)}
we use our own implementation.
This version will perform slightly slower than the v1.0.1 release.
The JIT should generate a single MUL instruction for Math#unsignedMultiplyHigh(long, long).
This workaround consists of 6 lines of Java code that simulates this instruction.
Commits
d62dcfa Use version number 2.0.0. Update README.md.
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps ch.randelshofer:fastdoubleparser from 1.0.1 to 2.0.0.
Release notes
Sourced from ch.randelshofer:fastdoubleparser's releases.
Commits
d62dcfa
Use version number 2.0.0. Update README.md.bd0723b
Replace Java 22 by Java 23 in README.md.4f8a183
Mark classes with final to make life easier for the JIT.b2fc12e
Return a magic bit pattern instead of throwing an exception.5e6ce73
Add javadoc for parameters.8dfe653
The constructor of NumberFormatSymbols creates defensive copies of all collec...583e836
Remove unused filterInputString() methods.74a507f
Improve code example.56e89d0
Add javadoc.114324c
Build without preview features.Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show