Skip to content

testPercentageReplacer fails #7

Open
@oliverskawronek

Description

@oliverskawronek

The PercentageReplacer executes

return String.format("%6.2f", progress.getPercentage() * 100);

I'am using german locale on my machine, and in german we use a comma instead of a point as decimal separator (unfortunately this is a common issue). The test against " 0.00" (with dot) fails due to the actual string is " 0,00" (with comma).

You can fix this by passing a explicit locale that is using a dot as decimal separator:

return String.format(Locale.US, "%6.2f", progress.getPercentage() * 100);

For more details please have a look on SO: https://stackoverflow.com/questions/5236056/force-point-as-decimal-separator-in-java

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions