-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
11,633 additions
and
297 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Tests | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
name: Run Tests | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: | ||
- 15 | ||
- 14 | ||
- 12 | ||
- 10 | ||
steps: | ||
- name: Check out the repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- run: npm test | ||
env: | ||
CI: true | ||
|
||
- name: Coveralls | ||
uses: coverallsapp/github-action@master | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,108 +1,107 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
|
||
<title>format-thousands</title> | ||
<title>format-thousands</title> | ||
<meta name="description" content="Format thousands with custom separator: 1 000 000"> | ||
|
||
<link rel="stylesheet" href="style.css"> | ||
</head> | ||
<body> | ||
<link rel="stylesheet" href="style.css"> | ||
</head> | ||
<body> | ||
|
||
<form | ||
class="formatter" | ||
action="" | ||
> | ||
<div class="formatter__input"> | ||
<input | ||
class="formatter__control formatter__control_name_number" | ||
value="1000000" | ||
type="number" | ||
name="number" | ||
placeholder="number" | ||
/> | ||
<form | ||
class="formatter" | ||
action="" | ||
> | ||
<div class="formatter__input"> | ||
<input | ||
class="formatter__control formatter__control_name_number" | ||
value="1000000" | ||
type="number" | ||
name="number" | ||
placeholder="number" | ||
/> | ||
|
||
<div class="formatter__options"> | ||
<input | ||
class="formatter__control formatter__control_name_separator" | ||
value="" | ||
type="text" | ||
name="separator" | ||
placeholder="separator" | ||
/> | ||
<div class="formatter__options"> | ||
<input | ||
class="formatter__control formatter__control_name_separator" | ||
value="" | ||
type="text" | ||
name="separator" | ||
placeholder="separator" | ||
/> | ||
|
||
<label class="formatter__checkbox"> | ||
<input | ||
name="formatFourDigits" | ||
value="formatFourDigits" | ||
checked="checked" | ||
type="checkbox" | ||
/> | ||
<label class="formatter__checkbox"> | ||
<input | ||
name="formatFourDigits" | ||
value="formatFourDigits" | ||
checked="checked" | ||
type="checkbox" | ||
/> | ||
|
||
<span> | ||
format four digits | ||
</span> | ||
</label> | ||
</div> | ||
</div> | ||
<span> | ||
format four digits | ||
</span> | ||
</label> | ||
</div> | ||
</div> | ||
|
||
<div class="formatter__output"> | ||
<input | ||
class="formatter__control formatter__control_name_result" | ||
value="" | ||
readonly | ||
type="text" | ||
name="result" | ||
placeholder="result" | ||
/> | ||
</label> | ||
</div> | ||
</form> | ||
<div class="formatter__output"> | ||
<input | ||
class="formatter__control formatter__control_name_result" | ||
value="" | ||
readonly | ||
type="text" | ||
name="result" | ||
placeholder="result" | ||
/> | ||
</div> | ||
</form> | ||
|
||
<a | ||
class="copyright" | ||
href="https://github.com/vovanr/format-thousands" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
tabindex="-1" | ||
> | ||
<span class="copyright__license">MIT ©</span> <span class="copyright__author">Vladimir Rodkin</span> | ||
</a> | ||
<a | ||
class="copyright" | ||
href="https://github.com/vovanr/format-thousands" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
tabindex="-1" | ||
> | ||
<span class="copyright__license">MIT ©</span> <span class="copyright__author">Vladimir Rodkin</span> | ||
</a> | ||
|
||
<script>window.module = {}</script> | ||
<script src="index.js"></script> | ||
<script> | ||
(function (formatThousands) { | ||
'use strict' | ||
<script>window.module = {}</script> | ||
<script src="index.js"></script> | ||
<script> | ||
(function (formatThousands) { | ||
'use strict' | ||
|
||
var form = document.forms[0] | ||
var elements = form.elements | ||
var numberControl = elements.number | ||
var separatorControl = elements.separator | ||
var resultControl = elements.result | ||
var formatFourDigits = elements.formatFourDigits | ||
var form = document.forms[0] | ||
var elements = form.elements | ||
var numberControl = elements.number | ||
var separatorControl = elements.separator | ||
var resultControl = elements.result | ||
var formatFourDigits = elements.formatFourDigits | ||
|
||
form.addEventListener('input', renderResult) | ||
form.addEventListener('change', renderResult) | ||
form.addEventListener('submit', function (event) { | ||
event.preventDefault(); | ||
}) | ||
form.addEventListener('input', renderResult) | ||
form.addEventListener('change', renderResult) | ||
form.addEventListener('submit', function (event) { | ||
event.preventDefault(); | ||
}) | ||
|
||
function renderResult() { | ||
var options = { | ||
separator: separatorControl.value || undefined, | ||
formatFourDigits: formatFourDigits.checked | ||
} | ||
resultControl.value = formatThousands(numberControl.value, options) | ||
} | ||
function renderResult() { | ||
var options = { | ||
separator: separatorControl.value || undefined, | ||
formatFourDigits: formatFourDigits.checked | ||
} | ||
resultControl.value = formatThousands(numberControl.value, options) | ||
} | ||
|
||
renderResult() | ||
renderResult() | ||
|
||
})(window.module.exports) | ||
</script> | ||
})(window.module.exports) | ||
</script> | ||
|
||
</body> | ||
</body> | ||
</html> |
Oops, something went wrong.