Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All!!
I'm trying to do a function like i show, but i can't get the result that i hope.
The function it's transformating the value of the parameter to a format value even Milllion, thousands....
Here I put some examples to do this with a function:
SUB formatNum (Value)
IF Value<num(100000) THEN
Value = Num(Value,'#.##0 €;-#.##0 €')
ELSEIF Value<num(1000000)
Value = Num(Value/num(1000),'#.##0,0 k€;-#.##0,0 k€')
ELSE
Value = Num(Value/num(1000000),'#.##0,00 M€;-#.##0,00 M€')
ENDIF
ENDSUB
OR with a Calculated Variable:
LET suma= 'IF($1<num(99999), Num($1,"#.##0 €;-#.##0 €"), IF($1<num(1000000), Num($1/num(1000),"#.##0,0 k€;-#.##0,0 k€"), Num($1/num(1000000),"#.##0,00 M€;-#.##0,00 M€")))';
The code its rigth, but i can't call the sub function from an text object, and i can't get the correct result with the calculatedValue because I dont escape the simple comma char.
Note: to call the calculated variable use:
=$(suma(3131231211231223))
Thanks All and Regards.
Try this:
SET suma= IF($1<num(99999), Num($1,'#.##0 €;-#.##0 €'), IF($1<num(1000000), Num($1/num(1000),'#.##0,0 k€;-#.##0,0 k€'), Num($1/num(1000000),'#.##0,00 M€;-#.##0,00 M€')));
Try this:
SET suma= IF($1<num(99999), Num($1,'#.##0 €;-#.##0 €'), IF($1<num(1000000), Num($1/num(1000),'#.##0,0 k€;-#.##0,0 k€'), Num($1/num(1000000),'#.##0,00 M€;-#.##0,00 M€')));
Thank you!! It's a good solutions and learn how to resolve it!!