I have angular options where i am displaying file Size but i am using variable value to calculate some bytes where i need just integer like if user select "1MB" i want to assign to variable maxMb 1. is it possible with javascript ?
ctrl.js
var maxMb;
$scope.FileSizeOptions = ["1MB","2MB","3MB","4MB","5MB"];
$scope.$watch('selectedFileSize',function (Val) {
maxMb = Val;
console.log('File Size', maxMb);
})
var maxBytes = 1000 * 1000 * maxMb;
filesizeoptions = {"1MB" : 1, "2MB":2}, or some string hacking/conversion to extract the integer from your string.parseInt('1MB') -> 1