Millier separtor in React Mui TextField

I’m trying to add millier separator to my mui-textField value,knowing that i already made digit separation.my code looks like this:

<TextField
                    size='small'
                    label='Total Cotisations Encaissées'
                    value={
                        totalEncaissement
                         ?.toFixed(modeMO)
                        ?.replace(/d(?=(d{3})+.)/g, "$& ") || 0
                    }
                    variant='outlined'
                    fullWidth
                    type={"number"}
                />
            </Grid>

The field doesn’t dispay anything when i add replace, but works totally fine with toFormat only
Please could somebody help