cancel
Showing results for 
Search instead for 
Did you mean: 

Move minus sign(-) from end to start of field in sap conversational ai

rshakya
Explorer
356

Hi Experts,

How to Move minus sign(-) from end to start of field.

below this code only replace the value but i didn't find any solution how to move minus sign (-) to start of field.

EX. 76800-, i want to display it as -76800

[{{#eachJoin api_service_response.default.body.d.results}}  {{formatNumber (replace NET_VAL '-' '') 2}}
{{/eachJoin}}]

Thanks in advance! 🙂

Riya Shakya

Accepted Solutions (0)

Answers (1)

Answers (1)

Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos

It depends how much information you know about the return value ahead of time and as Jonas said whether it’s a string or number


assuming it’s a string and the minus sign only appears for negative numbers and always appears for negative numbers, you can check for occurrences of - and if 1, run your function and add the minus at the beginning with append