- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2019 06:32 AM
I'm trying to change a dot to a comma but a cannot get it to work.
Any ideas?
I'm not sure if I need the parseFloat, doesn't make a different though.
Also, setValue in the end tries to go multiple times...
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var fte = g_form.getValue('fte');
if(fte.indexOf('.')){
parseFloat(fte);
fte.replace(/./g, ',');
g_form.setValue('fte', fte);
}
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2019 06:39 AM
Hi,
Use this piece of code:
var fte = g_form.getValue('fte').toString();
if(fte.indexOf('.')>-1){
fte.replace('.', ',');
g_form.setValue('fte', fte);
Regards,
Munender
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2019 06:39 AM
Hi,
Use this piece of code:
var fte = g_form.getValue('fte').toString();
if(fte.indexOf('.')>-1){
fte.replace('.', ',');
g_form.setValue('fte', fte);
Regards,
Munender
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2019 06:46 AM
Hello Jonatan,
Replace your code with this;
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var originalText = g_form.getValue('fte');
var formattedText;
if(originalText.indexOf('.')){
formattedText = originalText.replace(".", ",");
g_form.setValue('fte', formattedText);
}
}
Thanks,
Abhishek
Abhishek Gardade