Hello,
I am using the following jQuery script to replace the thousand separators “.” or “,” with “'” (the result will be 5’400’000) in several input fields (Type “text”):
$(document).ready(function(){
$('.totalkg input').on('change', function() {
// Retrieve the current value of the input field
var value = $(this).val();
// Remove thousands separator (both "." and ",")
var newValue = value.replace(/[.,]/g, "'");
// Set the new value in the input field
$(this).val(newValue);
});
});
The form contains 2 input fields (type “Text”) and a 3rd input field (type “Number”). I calculate a multiplication from the two input fields and output it in the 3rd field (number).
Everything works perfectly.
I would now like to transfer the calculated result from the 3rd field (number) to another text field (type “Text”) using @{:3} (for the “Default value” option in this field). I made some tests with a text and numbers field.
The problem is now, that this value will be displayed as "5.400.000) but the “.” should also be replaced with “'”.
How can I do that?
Thanks a lot for help,
Michael