Skip to content

Add locale parameter for numberFormat #3628

@Slava96

Description

@Slava96

Use case

When mapping from BigDecimal / double to String type (maybe like a number with 2 digits after separator), then it choose separator with honor to default program locale.
So, the results is incosistent. On my computer i have a locale with "ru/RU" and it choose ',' as separator, but on remote tests with locale "en/US" it chooses '.'

Generated Code

Add a locale parameter with conjuction to numberFormat

Possible workarounds

Workaround - have a separate util method with manually created DecimalFormat.

MapStruct Version

MapStruct 1.5.5.Final

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions