formatMeters() public static method

Formats the given double into meters.
public static formatMeters ( double d ) : string
d double The double to format
return string
Exemplo n.º 1
0
        // debugging function
        private void drawEncounter(Color defaultColor)
        {
            // Additional Information
            if (options.showOrbitInfo)
            {
                // Find the next encounter, if any, in our flight plan.
                if (showEncounter)
                {
                    Orbit  nextEnc = NodeTools.findNextEncounter(curState.node);
                    string name    = "N/A";
                    string PeA     = "N/A";

                    if (nextEnc != null)
                    {
                        name = nextEnc.referenceBody.name;
                        PeA  = NodeTools.formatMeters(nextEnc.PeA);
                    }
                    else
                    {
                        curState.encounter = false;
                    }
                    // Next encounter periapsis
                    GUIParts.drawDoubleLabel("(" + name + ") Pe:", 100, PeA, 130);
                    GUILayout.BeginHorizontal();
                    GUILayout.Label("", GUILayout.Width(100));
                    GUIParts.drawButton("Focus on " + name, defaultColor, delegate() { MapView.MapCamera.SetTarget(name); });
                    GUILayout.EndHorizontal();
                }
                else
                {
                    if (curState.node.solver.flightPlan.Count > 1)
                    {
                        // output the apoapsis and periapsis of our projected orbit.
                        GUIParts.drawDoubleLabel("Apoapsis:", 100, NodeTools.formatMeters(curState.node.nextPatch.ApA), 100);
                        GUIParts.drawDoubleLabel("Periapsis:", 100, NodeTools.formatMeters(curState.node.nextPatch.PeA), 130);
                    }
                }
            }
        }