You need to sign in to do that
Don't have an account?
Andrey Bolkonsky
How to get the Length of an Integer?
This is probably a very stupid question but I am very new to this. I cannot find a way to get the length of an integer in the sample below. I thought it would be Amount.length() or Amount.getLength but I keep gettin the error: Method does not exist of incorrect signature. Thanks.
public String writeNumber(Integer a) {
a=Amount;
Integer len=Amount.getLength();
}
public String writeNumber(Integer a) {
a=Amount;
Integer len=Amount.getLength();
}
Hi Cameron,
getLength() is not a valid function on integer, but you can calculate the length of an integer by converting it to a string.
for example:
If you find this solution is helpful for you please mark the best answer
All Answers
Hi Cameron,
getLength() is not a valid function on integer, but you can calculate the length of an integer by converting it to a string.
for example:
If you find this solution is helpful for you please mark the best answer