Negative currency format
Posted: 18 Jul 2019
Hi there!
I have a calculated field on the display form in currency format. Users want to see negative numbers in (), i.e.: -$488.64 = ($488.64)
I tried this code:
The alert shows it fine, but the field is still showing it with "-" .... Can you help please? Is there any easy solution for that? I found this js library, but i thought if i can just do it on the form it would be better.
I have a calculated field on the display form in currency format. Users want to see negative numbers in (), i.e.: -$488.64 = ($488.64)
I tried this code:
Code: Select all
function setNegEUR() {
var eurneg = fd.field('EUR_ReturnCAD').value();
if (eurneg.indexOf('-') !== -1) {
eurneg = '(' + eurneg.replace('-', '') + ')';
alert(eurneg);
}
fd.field('EUR_ReturnCAD').value(eurneg);
}
setNegEUR();