Hi everyone.
I’m trying to build a extension in appybuilder.
I have some errors, i’m not expert in java… is there some code checker or compiler to that code??
Thanks.
Hi everyone.
I’m trying to build a extension in appybuilder.
I have some errors, i’m not expert in java… is there some code checker or compiler to that code??
Thanks.
Hi
Please post your code so that we can have a look at that.
@SimpleFunction(description = "Centesimal to Sexagesimal")
public double CenttoSexg(double Coord) {
double degrees = (int) Coord;
double minutes = (degrees - (int) degrees) * 60;
double seconds = (minutes - (int) minutes) * 60;
return String.join(String.valueOf(degrees)," ",String.valueOf(minutes)," ",String.valueOf(seconds));
}
Errors are obvious. You can’t return String from a double
returning method.
Ohhh god, my failure, i should modify the public double to public string, right?
As i said…not java programmer thanks…
Yes.Simply replace double
with String.
Still not work, now no error on compiler but when load extension, something related to Join method…
java.lang.nosuchmethoderror: no stactit method Join …
Just trying to calculate some values and join they in a string…
public UTMCoordinates(ComponentContainer container) {
super(container.$form());
this.container = container;
}
@SimpleFunction(description = "Centesimal to Sexagesimal")
public String CenttoSexg(double Coord) {
double degrees = (int) Coord;
double minutes = (degrees - (int) degrees) * 60;
double seconds = (minutes - (int) minutes) * 60;
String out = String.join(String.valueOf(degrees)," ",String.valueOf(minutes)," ",String.valueOf(seconds))
return out;
}
String.join wrong … first should be the delimiter…
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.