Example: lr_convert_double_to_integer

In the following example, lr_convert_double_to_integer converts the string representation of a double to the string representation of an int.


lr_save_string("1.0502731456E7","sourceParam");
lr_save_string("10062731.0","sourceParam2");

lr_convert_double_to_integer("sourceParam","outparam");
lr_output_message("[%s] converted to: [%s]",
lr_eval_string("{sourceParam}"),lr_eval_string("{outparam}"));

lr_convert_double_to_integer("sourceParam2","outparam");
lr_output_message("[%s] converted to: [%s]",
lr_eval_string("{sourceParam2}"),lr_eval_string("{outparam}"));
 
Output:
Action.c(16): [1.0502731456E7] converted to: [10502731]
Action.c(19): [10062731.0] converted to: [10062731]