Skip to content

Commit 514a94e

Browse files
committed
Add support of currencySymbol from cultureInfo for inputmask
1 parent 6bb7636 commit 514a94e

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

examples/jquery/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function init() {
4040

4141
Survey.defaultBootstrapCss.navigationButton = "btn btn-primary";
4242
//Survey.Survey.cssType = "bootstrapmaterial";
43-
Survey.Survey.cssType = "bootstrap";
43+
Survey.Model.cssType = "bootstrap";
4444

4545
var model = new Survey.Model(json);
4646
window.survey = model;

src/inputmask.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ function init(Survey) {
77
numericAutoGroup: true,
88
numericDigits: 2,
99
numericDigitsOptional: false,
10-
numericPrefix: "$",
1110
numericPlaceholder: "0",
1211
autoUnmask: true,
1312
widgetIsLoaded: function() {
@@ -27,8 +26,9 @@ function init(Survey) {
2726
"inputFormat",
2827
{
2928
name: "prefix",
30-
default: "$"
29+
visible: false
3130
},
31+
"currencySymbol",
3232
{
3333
name: "autoUnmask:boolean",
3434
default: true
@@ -79,7 +79,9 @@ function init(Survey) {
7979
if (surveyElement.inputMask == "currency") {
8080
options.digits = rootWidget.numericDigits;
8181
options.digitsOptional = rootWidget.numericDigitsOptional;
82-
options.prefix = surveyElement.prefix || rootWidget.numericPrefix;
82+
options.prefix = surveyElement.currencySymbol || surveyElement.prefix ||
83+
Survey.cultureInfo && Survey.cultureInfo.getCulture(
84+
surveyElement.culture).currencySymbol || "";
8385
options.placeholder = rootWidget.numericPlaceholder;
8486
}
8587
if (surveyElement.inputMask == "datetime") {

0 commit comments

Comments
 (0)