You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2026/10/06 06:09:00 UTC
[jira] [Work started] (CAMEL-25366) camel-core - No type converter from String or Number to BigDecimal, so simple bodyAs/convertTo/resultType BigDecimal give null
[ https://issues.apache.org/jira/browse/CAMEL-25366?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Work on CAMEL-25366 started by Claus Ibsen.
-------------------------------------------
> camel-core - No type converter from String or Number to BigDecimal, so simple bodyAs/convertTo/resultType BigDecimal give null
> ------------------------------------------------------------------------------------------------------------------------------
>
> Key: CAMEL-25366
> URL: https://issues.apache.org/jira/browse/CAMEL-25366
> Project: Camel
> Issue Type: Bug
> Components: camel-core
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Priority: Minor
>
> Camel core has type converters from String, Number and byte[] to Byte, Short, Integer, Long, Float, Double and BigInteger, but none to java.math.BigDecimal.
> So converting the String "1000.01" to BigDecimal returns null without an error, and the simple language shows it as empty:
> {code}
> ${bodyAs(java.math.BigDecimal)}
> ${convertTo(${body}, java.math.BigDecimal)}
> simple with resultType: java.math.BigDecimal
> {code}
> Comparisons such as ${body} > 1000 work because the comparison parses decimals itself (CAMEL-25013), which hides the gap.
> This is common for money amounts read from CSV or JSON. Add a toBigDecimal converter next to toBigInteger in ObjectConverter.
> _Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v8.20.10#820010)