Skip to content

Commit

Permalink
fix formatter in value type syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
sboeckelmann committed Aug 21, 2024
1 parent f30e67d commit ab65f68
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import java.io.Serializable;
import java.util.List;
import java.util.Locale;

@Setter
@Getter
Expand Down Expand Up @@ -50,7 +51,7 @@ private double generateRandomValue(final List<RandomGenerators> randomGenerators
//If user specified format for RandomGenerator then format based on specific format
if(!StringUtils.isBlank(generatorConfig.getFormatValue())){
try{
return Double.parseDouble(String.format(generatorConfig.getFormatValue(), sample));
return Double.parseDouble(String.format(Locale.US, generatorConfig.getFormatValue(), sample));
}catch (Exception ex){
throw new TestDataGeneratorException("Invalid format value provided for formatting Random value : " + ex.getMessage(), ex);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@
"name": "RandomGen-1",
"description": "Random Generator",
"minValue": 10,
"maxValue": 12,
"meanValue": 20,
"maxValue": 20,
"meanValue": 12,
"seedValue": 1721996358265,
"formatValue": "%.2f",
"distributionType": "TriangularDistribution",
Expand Down

0 comments on commit ab65f68

Please sign in to comment.