scalacheck icon indicating copy to clipboard operation
scalacheck copied to clipboard

Expose Gens for BigDecimal with provided scale

Open larsrh opened this issue 5 years ago • 1 comments

In #670, @non introduced two methods that return Gens with a provided scale:

def chooseBigDecimalScale(minScale: Int): Choose[BigDecimal]
def chooseJavaBigDecimalScale(minScale: Int): Choose[JavaDecimal]

Both of them are private. We should consider making them public.

larsrh avatar Oct 24 '20 09:10 larsrh

Also documntation states:

The implicit instance fixes this value, but since users may want to use other scales we expose this method as well.

but method is not exposed.

As a workaround I think .setScale on a generated BigDecimal should do the trick.

ilinandrii avatar Aug 14 '23 10:08 ilinandrii