The scenario is, I have two arrays as below. I want to convert the values from the arrays by converting the negative elements to "", and also removing de decimals from all the elements. For the second array the same but for positives, see this example:
Case1: var arr=["1.00","-2.05","-3P","-$8M","5P","6$","-5.0%"]
/*logic to make arr[] as below: */
var arr2=["1","","","","5P","6$",""]
console.log(arr2)
Case2: var arr=["1.00","-2.05","-3P","-$8M","5P","6$","-5.0%"]
/*logic to make arr[] as below: */
var arr2=["","-2","-3P","-$8M","","","-5%"]
console.log(arr2)
Note: I want to take string with decimal as string without decimal as well.