What is format_calculator_string in Gauge API, and how does it work?

Very short question: What is format_calculator_string and how is it used? I have literally found NO documentation nor any useful information. Just curious.

I am assuming its the same as was in FSX & P3D

P3D has quite good documentation … see

https://www.prepar3d.com/SDKv4/sdk/panels_and_user_interface/gauges/references/gauges_api_overview.html#format_calculator_string

Hey @N6722C,

Thanks for your quick reply. But unfortunately… have you looked in the documentation? Or I must be missing something, but it is not adding any value :frowning:

No blame on you of course! At least you tried :slight_smile:

The link I gave was for the “Format_Calculator_String” as documented in P3D, as it does snot appear to be documented yet in the MSFS SDK.

https://www.prepar3d.com/SDKv4/sdk/panels_and_user_interface/gauges/references/gauges_api_overview.html#format_calculator_string

format_Calculator_String

Although I agree with you that in several cases, the prepare3D documentation is a lot better, I still don’t know what format_calculator_string is doing exactly. Could you give an example?

By the way, this is documented in the SimConnect SDK Documentation here, and it looks exactly the same as the info found on Prepare3D.

So it does !!! Missed that .

I have no idea what “calculator code” is all about :hushed: apart from wild guessing

Like most MSFS unknowns, searching for examples is about the only way to figure some of it out

I know what image
is doing (in fact, very simple, it is executing a string of RPN code from the WASM Module), but I don’t know what image
is doing.

And unfortunately, I have found not a single example on the web yet :frowning:

Howdy… I know this is an old post and I’m new here, but as seemingly no one on the whole Internet can explain what format_calculator_string() does, and this post is 2nd result on Google…

format_calculator_string() is just like execute_calculator_code() but it allows the results to be formatted as a string, using the string formatting features described in the RPN docs:

https://docs.flightsimulator.com/html/Additional_Information/#strings

And naturally it populates a string (pointer) vs. the individual float/int/string values like “exec” does.

HTH!
-Max