Skip to content

Commit 9f7c83e

Browse files
Added proptype
1 parent 9abd702 commit 9f7c83e

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/components/Input/index.jsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,15 @@ Input.propTypes = {
192192
* To specify the type of Input field.
193193
*/
194194
type: PropTypes.string,
195+
/**
196+
* To specify how many decimal places to show in the input.
197+
*
198+
* For example, if precision is 2:
199+
* 10 will be shown as "10.00"
200+
* 10.1 will be shown as "10.10"
201+
* 9.758 will be rounded and shown as "9.76"
202+
*/
203+
precision: PropTypes.number,
195204
/**
196205
* To specify the label props to be passed to the Label component.
197206
*/

types/Input.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ export interface InputProps
1515
helpText?: string;
1616
className?: string;
1717
nakedInput?: boolean;
18+
precision?: number;
1819
contentSize?: number;
1920
required?: boolean;
2021
labelProps?: LabelProps;
2122
maxLength?: number;
2223
unlimitedChars: boolean;
2324
rejectCharsRegex?: RegExp;
24-
precision?: number;
2525
}
2626

2727
const Input: React.ForwardRefExoticComponent<InputProps>;

0 commit comments

Comments
 (0)