Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Float to string musing... #868

Closed
fishykins opened this issue Jan 6, 2018 · 4 comments · Fixed by #887
Closed

Float to string musing... #868

fishykins opened this issue Jan 6, 2018 · 4 comments · Fixed by #887
Labels
Milestone

Comments

@fishykins
Copy link
Contributor

Not so much an issue, rather a question re cba_fnc_floatToString. I have, on rare occasion, been sending values of 0 to this function. The result is a thrown error but nothing broken. Having taken a look at it, I can see that it is highly bare bones and designed to run super-duper fast which is great. Is there a possibility of catching this value of "0" in the function or should this be included before?

eg:

private _string = if (_float isEqualto 0) then {"0";} else {float call cba_fnc_floatToString;};

Thanks!

@kymckay
Copy link
Contributor

kymckay commented Jan 6, 2018

Would it not be faster to use the engine command toFixed?

@fishykins
Copy link
Contributor Author

looks like it, yes. Does that not render the function as depreciated?

@commy2
Copy link
Contributor

commy2 commented Jan 6, 2018

I'd say so.

@commy2 commy2 added the Cleanup label Feb 8, 2018
@commy2 commy2 added this to the 3.7 milestone Feb 8, 2018
@commy2
Copy link
Contributor

commy2 commented Feb 8, 2018

Function will be marked as deprecated (though probably never removed in A3)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants