mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
use js toLocaleString rather than custom insert commas function
ref #272
This commit is contained in:
parent
6e42ed8754
commit
9c45afc896
1 changed files with 1 additions and 6 deletions
|
|
@ -58,17 +58,12 @@ export class Home extends React.Component<RouteComponentProps<{}>, IHomeState> {
|
|||
|
||||
private static renderTagline(state: IHomeState) {
|
||||
return <p className="ml-2 mr-2">
|
||||
The independent, comprehensive directory of <strong>{this.insertCommasInNumber(state.ruleCount)
|
||||
The independent, comprehensive directory of <strong>{state.ruleCount.toLocaleString()
|
||||
}</strong> unique rules across <strong>{state.lists.length
|
||||
}</strong> filter and host lists for advertisements, trackers, malware, and annoyances.
|
||||
</p>;
|
||||
}
|
||||
|
||||
//https://stackoverflow.com/a/2901298/2343739
|
||||
private static insertCommasInNumber(num: number) {
|
||||
return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
}
|
||||
|
||||
private static renderFilterListsTable(filterLists: IListDto[]) {
|
||||
return <ReactTable
|
||||
data={filterLists}
|
||||
|
|
|
|||
Loading…
Reference in a new issue