mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-19 00:39:58 +00:00
Fix rounding errors when parsing coordinates. Add location constructors that take a Point rather than lat and lon.
This commit is contained in:
parent
3c5dc7c328
commit
589cf69063
9 changed files with 1056 additions and 1123 deletions
|
@ -160,16 +160,16 @@ public final class XmlPullUtil
|
|||
return defaultValue;
|
||||
}
|
||||
|
||||
public static float floatAttr(final XmlPullParser pp, final String attrName)
|
||||
public static double floatAttr(final XmlPullParser pp, final String attrName)
|
||||
{
|
||||
return Float.parseFloat(attr(pp, attrName));
|
||||
return Double.parseDouble(attr(pp, attrName));
|
||||
}
|
||||
|
||||
public static float optFloatAttr(final XmlPullParser pp, final String attrName, final float defaultValue)
|
||||
public static double optFloatAttr(final XmlPullParser pp, final String attrName, final float defaultValue)
|
||||
{
|
||||
final String attr = optAttr(pp, attrName, null);
|
||||
if (attr != null)
|
||||
return Float.parseFloat(attr);
|
||||
return Double.parseDouble(attr);
|
||||
else
|
||||
return defaultValue;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue