diff --git a/README.md b/README.md index c86e7ce..9a59d26 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,7 @@ const App = () => { | `enterAnimationType` | no | `'slide-in-up' or 'slide-in-down'` | Whether the new digit should enter from the top or the bottom | | `separatorStyle` | no | `StyleProp` | Extra style applied only to separators. In this case, the colon (`:`) and the comma (`,`) | | `textCharStyle` | no | `StyleProp` | The style applied to each individual character of the stopwatch/timer | +| `decimalSeparator` | no | `string` | Decimal separator for formatting time. Defaults to a comma `,` | ## Methods diff --git a/src/StopwatchTimer.tsx b/src/StopwatchTimer.tsx index 5ee9f9a..0a95bae 100644 --- a/src/StopwatchTimer.tsx +++ b/src/StopwatchTimer.tsx @@ -69,6 +69,10 @@ export interface StopwatchTimerProps { * If 1, the component will display seconds, minutes and hundredth of ms. */ trailingZeros?: 0 | 1 | 2; + /** + * Decimal separator for formatting time. Defaults to a comma (','), but any string can be used for custom formats. + */ + decimalSeparator?: string; } export interface StopwatchTimerMethods { @@ -105,6 +109,7 @@ function Stopwatch( separatorStyle, textCharStyle, trailingZeros = 1, + decimalSeparator = ',', }: StopwatchTimerProps, ref: ForwardedRef ) { @@ -241,7 +246,7 @@ function Stopwatch( separatorStyle, ]} > - , + {decimalSeparator}