---
title: "Разделение числа на тысячи, точками (запятыми, пробелами)"
description: "function DigitsFormat(str) { str = str.replace(/\\s+/g,'') return str.replace(/(\\d)(?=(\\d\\d\\d)+([^\\d]..."
author: "Fozzy"
published: "2011-11-21T02:59:09+00:00"
modified: "2011-11-21T02:59:09+00:00"
locale: "ru"
canonical_url: "https://yvision.kz/post/razdelenie-chisla-na-tysyachi-tochkami-zapyatymi-probelami-207558"
markdown_url: "https://yvision.kz/post/razdelenie-chisla-na-tysyachi-tochkami-zapyatymi-probelami-207558/markdown"
site_name: "Yvision.kz"
---

# Разделение числа на тысячи, точками (запятыми, пробелами)

> function DigitsFormat(str) { str = str.replace(/\s+/g,'') return str.replace(/(\d)(?=(\d\d\d)+([^\d]...

function DigitsFormat(str) { str = str.replace(/\s+/g,'') return str.replace(/(\d)(?=(\d\d\d)+([^\d]|$))/g, '$1 '); }

---

Source: [https://yvision.kz/post/razdelenie-chisla-na-tysyachi-tochkami-zapyatymi-probelami-207558](https://yvision.kz/post/razdelenie-chisla-na-tysyachi-tochkami-zapyatymi-probelami-207558)