Are string numeric literals with floating point suffix the valid CLI arguments in Ballerina?

42 Views Asked by At

The Ballerina specification on fromString() methods of langlibs float and decimal says that the FloatingPointTypeSuffix is not allowed. Should this be considered for CLI args also?

import ballerina/io;

public function main(decimal d) {
    io:println(d);
}

For example, is "12.53d" a valid CLI argument to pass here?

1

There are 1 best solutions below

0
On

is "12.53d" a valid CLI argument to pass here?, No, FloatingPointTypeSuffix is not allowed.

This is because we have to use the same fromString() function to convert CLI arguments internally.