playMaker

Author Topic: String to float - reduced precision  (Read 2060 times)

Revitspace

  • Playmaker Newbie
  • *
  • Posts: 6
String to float - reduced precision
« on: August 22, 2016, 04:34:25 PM »
Hi

I'm grabbing some Longitude and latitude coordinates from am XML (Google API) and iterating through the results and storing them in an array list as a string, then using these results using the playmaker "plot location to map" action to plot the location on a map.

The issue I am having is that the "plot location to map" required float values for lay/longitude so I am using the "string to float action" to do this conversion and it appears to be losing precision and cutting off the last two digits of the lat/long?

Anyone know a easy solution please, I'm loving playmaker and have been to prototype up my game without any issues until I came across this.

Thanks

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: String to float - reduced precision
« Reply #1 on: August 23, 2016, 05:43:04 AM »
Hi,
the problem is that a float has a limit of 7 digits.
so maybe you have to split them up.
if the value would be 123.654321
float 1 would be 123 and float 2 0.654321

in C# you can use a double variable, but in pm i can't see to find actions for double.
I will do a request to support doubles on pm

Revitspace

  • Playmaker Newbie
  • *
  • Posts: 6
Re: String to float - reduced precision
« Reply #2 on: August 24, 2016, 01:01:39 PM »
Thanks for this,  figured out how to split the value into two but then bringing thins back into a float (as that's the variable the plot to map action needs) still has the same issue as the floats only support 7 digits.

If we can get PM support for doubles in future that would be great and solve my issue.

Thanks.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: String to float - reduced precision
« Reply #3 on: August 25, 2016, 04:16:09 AM »
Hi,
I have added a feature request here
and Action request here