it is possible to define num format for a variable
for example var a1 = NumericField1.rawvalue & var a2 = NumericField1.rawvalue var total = a1 + a2 (num format, z,zz,zz,z9.99)
this.rawValue = " My Score" + total;
i tried many ways but always failed.
Solved! Go to Solution.
You can use util.printf
e.g.
util.printf('%,0.2f', 12345.67)
will give you
12,345.67
I assume the code 'this.rawValue = "My Score " + total' is in a calculate event of a field? You could try adding a display pattern to that field of
num{'My score ' z,zzz,zz9.zz}
Then the calculate event code would just be 'this.rawValue = total'
Views
Replies
Total Likes
There are any other way to define format under varible script
Views
Replies
Total Likes
You could use a text field instead of a numeric field and create the desired string by joining parts.
; FormCalc
$ = Concat("My score ", Sum(NumericField1, NumericField2))
//JavaScript
this.rawValue = "My score ".concat((NumericField1.rawValue + NumericField2.rawValue));
Views
Replies
Total Likes
You can use util.printf
e.g.
util.printf('%,0.2f', 12345.67)
will give you
12,345.67
thank you very much
Exactly i search for it.
Views
Replies
Total Likes
I see what you mean, I didn't think it worked like that.
Seems text{'name 'XXXXXXXXXXXXXXX' '} would work, that is adding a space at the end.
Just make sure there are more 'X's than your longest value.
working fine
Thanks a lot
Views
Replies
Total Likes
Views
Likes
Replies