Hi a basic question, how do I get the value of a p...
# suitescript
j
Hi a basic question, how do I get the value of a percent custom field, if I use the function I get "30%" as a string
b
the function
is not descriptive enough to tell what you are doing
j
This is what I'm doing
var markup = paramsResults[0].getValue({name: 'custrecord_pse_markup'});
But when I log the markup value it returns "30%" so I cannot use it in math operations unless I convert it to number
b
parse the number
preferably using format.parse if there are localization concerns
j
ok let me try that, i use parseFloat(markup.slice(0,-1)); But I'll try with format.parse
b
localization concerns means you want your code to work when the user uses
,
instead of
.
as the decimal separator
j
thanks