You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fesod.apache.org by "BigDataDZ (via GitHub)" <gi...@apache.org> on 2026/10/04 02:36:37 UTC
[PR] fix: recognize scaled one values as true in BigDecimalBooleanConverter (#1150) [fesod]
BigDataDZ opened a new pull request, #1177:
URL: https://github.com/apache/fesod/pull/1177
## What changed
`BigDecimalBooleanConverter#convertToExcelData` now checks the value with `BigDecimal#compareTo` (null-safe) instead of `BigDecimal#equals`, so every value numerically equal to one converts to Excel `TRUE` regardless of its scale.
## Why
`BigDecimal#equals` is scale-sensitive, so numerically equivalent values such as `1.0` and `1.00` were written as `FALSE`:
```java
converter.convertToExcelData(new BigDecimal("1.0"), null, null).getBooleanValue();
// was false, now true
```
Fixes #1150
## How tested
New unit test `BigDecimalBooleanConverterTest`:
- `1`, `1.0`, `1.00` convert to `TRUE`
- `0`, `0.0`, `2` and `null` convert to `FALSE` (previous behavior preserved for non-one values)
- read direction still maps `TRUE`/`FALSE` to `BigDecimal.ONE`/`BigDecimal.ZERO`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For additional commands, e-mail: commits-help@fesod.apache.org
Re: [PR] fix: recognize scaled one values as true in BigDecimalBooleanConverter (#1150) [fesod]
Posted by "delei (via GitHub)" <gi...@apache.org>.
delei commented on PR #1177:
URL: https://github.com/apache/fesod/pull/1177#issuecomment-6064969705
Thanks for submitting this PR!
It looks like a solid change, but this is a duplicate PR, so I’ll close this one to avoid duplicate discussion and merging.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For additional commands, e-mail: commits-help@fesod.apache.org
Re: [PR] fix: recognize scaled one values as true in BigDecimalBooleanConverter (#1150) [fesod]
Posted by "delei (via GitHub)" <gi...@apache.org>.
delei closed pull request #1177: fix: recognize scaled one values as true in BigDecimalBooleanConverter (#1150)
URL: https://github.com/apache/fesod/pull/1177
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For additional commands, e-mail: commits-help@fesod.apache.org