How to convert a string to integer / decimal?
Hi,
I've got a select list for a quantity calculation with following values
0.5
1
1.5
2
etc...
I'm trying to check the input.caseLaborHrs and assign it as an integer or decimal but get the following error.
Variable 'qty1' is already defined of data type 'BIGINT' but trying to update 'DECIMAL' data type
My code is below... not sure if I'm coming at this completely wrong! My goal is to use this value to do a calculation to auto-create a sales order from a case based on the input Labor hours. eg: LaborRate * HoursWorked
- if (input.caseLaborHrs = null)
- {
- qty1 = 1;
- }
- else if (input.caseLaborHrs.contains("."))
- {
- qty1 = input.caseLaborHrs.toDecimal();
- }
- else
- {
- qty1 = input.caseLaborHrs.toLong();
- }
Appreciate any help or guidance!