import { format } from '../../decimal';

export default function decimal(
  {
    fixed,
    label,
    max,
    min,
  }: {
    fixed?: number;
    label?: string;
    max?: number;
    min?: number;
  } = {
    max: Number.MAX_SAFE_INTEGER,
    min: Number.MIN_SAFE_INTEGER,
  }
) {
  const _min = min || Number.MIN_SAFE_INTEGER;
  const _max = max || Number.MAX_SAFE_INTEGER;
  return format(_min + (_max - _min) * Math.random(), fixed);
}
