You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment when mocking any numbers they will always be integers since they are mocked with faker.number.int function. Only integers should be mocked with int and regular numbers should be mocked with float function. You can currently specify float or double as a format for number but it doesn't take into account for example minimum and maximum attributes. We could settle with some kind of default precision for floating point numbers since I don't think people want numbers with tons of decimals as default so maybe defaulting to say 2 would be reasonable. Mock options could allow setting fractionDigits option (same name as in Fakerjs 9) that allows user to set what they want as precision when mocking floats. This behavior would be overridden if user specifies multipleOf in source file since that will then determine the precision.
The text was updated successfully, but these errors were encountered:
At the moment when mocking any numbers they will always be integers since they are mocked with faker.number.int function. Only integers should be mocked with int and regular numbers should be mocked with float function. You can currently specify float or double as a format for number but it doesn't take into account for example minimum and maximum attributes. We could settle with some kind of default precision for floating point numbers since I don't think people want numbers with tons of decimals as default so maybe defaulting to say 2 would be reasonable. Mock options could allow setting fractionDigits option (same name as in Fakerjs 9) that allows user to set what they want as precision when mocking floats. This behavior would be overridden if user specifies multipleOf in source file since that will then determine the precision.
The text was updated successfully, but these errors were encountered: