title: extending existing validator and only set some options
body: <p>My database column is of type <strong>double precision</strong> (from the <a href="https://www.postgresql.org/docs/9.3/datatype-numeric.html" rel="nofollow noreferrer">Postgres docs</a>)</p>
  
  <blockquote>
    <p>double precision  8 bytes variable-precision, inexact 15 decimal digits precision</p>
  </blockquote>
  
  <p>Using class-validator I want to make a precision check</p>
  
  <pre><code>@IsNumber()
  /* precision check */
  public myValue: number;
  </code></pre>
  
  <p>The <code>IsDecimal</code> decorator might help here, so <code>@IsDecimal({ decimal_digits: '15' })</code> might do the trick. I would have to use this decorator for multiple fields, is there a way to extend the existing decorator and just pass in the <code>decimal_digits</code> option? I don't think it makes sense to reinvent the wheel. It would be nice if I could inherit the validation but set the precision to <strong>less or equal to 15</strong>.</p>
  
  <p>Currently I created my own decorator</p>
  
  <pre><code>@ValidatorConstraint()
  class IsDoublePrecisionConstraint implements ValidatorConstraintInterface {
      public validate(value: any): boolean {
          if (typeof value === 'number') {
              if (value % 1 === 0) {
                  return true;
              }
  
              const valueText: string = value.toString();
              const valueSegments: string[] = valueText.split('.');
              const decimalDigits: string = valueSegments[1];
  
              return decimalDigits.length &lt;= 15;
          }
  
          return false;
      }
  
      public defaultMessage(args: ValidationArguments): string {
          return `${args.property} must have less than or equal to 15 decimal digits.`;
      }
  }
  
  export function IsDoublePrecision() {
      return (object: Record&lt;string, any&gt;, propertyName: string) =&gt; {
          registerDecorator({
              target: object.constructor,
              propertyName,
              validator: IsDoublePrecisionConstraint,
          });
      };
  }
  </code></pre>
  
  <p>but I'm not sure if this one is able to handle every case.</p>
  
  <p>Thanks in advance</p>