lanka-validations - v2.1.0
    Preparing search index...

    Function isValidLKR

    • Validates whether the given value is a valid Sri Lankan currency amount.

      Parameters

      • input: unknown

        Amount as a number or text.

      • Optionaloptions: LkrValidationOptions

        Optional { min, max, allowNegative }. Bounds are inclusive; negatives are rejected by default.

      Returns boolean

      true if the amount parses and is within the bounds.

      isValidLKR('Rs. 1,500.00'); // true
      isValidLKR(-10); // false
      isValidLKR(250, { min: 500 }); // false