Skip to content

Commit

Permalink
Update Number.java
Browse files Browse the repository at this point in the history
  • Loading branch information
irakatz committed May 8, 2020
1 parent e96edfb commit ba3062d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/com/github/javafaker/Number.java
Expand Up @@ -113,7 +113,8 @@ private BigDecimal decimalBetween(long min, long max) {
final long randomChunk = faker.random().nextLong(decimalOfChunkCount);
final double chunkStart = trueMin + randomChunk * chunkCount;
final double adj = chunkCount * faker.random().nextDouble();
return chunkStart + adj >= trueMax ? new BigDecimal(trueMax -1) :new BigDecimal(chunkStart + adj);
if(chunkStart + adj >= trueMax) return new BigDecimal(trueMax -1);
else return new BigDecimal(chunkStart + adj);
}

public String digits(int count) {
Expand Down

0 comments on commit ba3062d

Please sign in to comment.