Skip to content

@checkout-kit/core / formatCardNumber

Variable: formatCardNumber ​

ts
const formatCardNumber: (value, brand?) => string;

Groups the digits the way the card is printed: 4-4-4-4, or 4-6-5 for Amex.

Parameters ​

ParameterType
valuestring
brand?CardBrand

Returns ​

string

Apache-2.0 · Headless engine, provider adapters and runnable examples.