<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to convert a number to string using specific format? For instance: {&amp;quot;Scientific&amp;quot;, 12} in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-convert-a-number-to-string-using-specific-format-For/m-p/904538#M106336</link>
    <description>&lt;P&gt;Ok, it might be version dependent then (I tried with JMP18/19). The sure way of doing this is using something like hogi did already demonstrate with the substitute+insert.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

f = {"Scientific", 12};
bb = 3.1415926535;

myval_format = Insert(f, bb, 1);

myval_str = Eval(Substitute(myval_format, {}, Expr(Format())));
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 29 Sep 2025 06:38:04 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2025-09-29T06:38:04Z</dc:date>
    <item>
      <title>How to convert a number to string using specific format? For instance: {"Scientific", 12}</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-convert-a-number-to-string-using-specific-format-For/m-p/904253#M106324</link>
      <description>&lt;P&gt;As a subject suggests, I need to convert a number to string using a specific format. To be precise: I have a handle on GB plot, and Text() near that handle that outputs current coordinates of the handle:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Text( Erased, {box:exx, box:exy} + box:axisRange * 0.01, "(" || Char( Round( box:exx, 2 ) ) || "," || Char( Round( box:exy, 2 ) ) || ") " ) ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;On some plots the Y Axis is very small and is displayed in Scientific format:&amp;nbsp; {"Scientific", 12}&lt;/P&gt;
&lt;P&gt;The idea is to grab the format from the axis (both of them) and format corresponding coordinates written in the Text() accordingly (instead of doing Round(xyz, 2).&lt;/P&gt;
&lt;P&gt;I tried a few different approaches, but they all error out.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any suggestions?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Sep 2025 22:26:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-convert-a-number-to-string-using-specific-format-For/m-p/904253#M106324</guid>
      <dc:creator>miguello</dc:creator>
      <dc:date>2025-09-26T22:26:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a number to string using specific format? For instance: {"Scientific", 12}</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-convert-a-number-to-string-using-specific-format-For/m-p/904335#M106327</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2581"&gt;@miguello&lt;/a&gt;&amp;nbsp;, you can use&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Format(value, "Scientific", width, decimals)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_1-1758948507750.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/83654iC5A0CFECE208BFC0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_1-1758948507750.png" alt="hogi_1-1758948507750.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 27 Sep 2025 05:25:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-convert-a-number-to-string-using-specific-format-For/m-p/904335#M106327</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2025-09-27T05:25:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a number to string using specific format? For instance: {"Scientific", 12}</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-convert-a-number-to-string-using-specific-format-For/m-p/904411#M106328</link>
      <description>&lt;P&gt;Ok, I tried it like below and it worked:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;  aa = rgbs &amp;lt;&amp;lt; XPath("//AxisBox");
  format1 = aa[1][2] &amp;lt;&amp;lt; Get Format;
  format2 = aa[2][2] &amp;lt;&amp;lt; Get Format;
  
  bb = 3.1415926535;
    
  Format(bb, format1[1], format1[2], format1[3]);
  Format(bb, format2[1], format2[2], format2[3]);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I have two GBs, Pulling formats from them yields:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;{"Scientific", 12}

{"Fixed Dec", 12, 2}&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;When using as I showed it correctly formats the number, even though format1 has only two members in the list. I guess it has an internal Try() or something.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Format(bb, format1[1], format1[2], format1[3]);
/*:

"3.1415927e+0"
//:*/
Format(bb, format2[1], format2[2], format2[3]);
/*:

"3.14"&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Any way to just use pulled format without spelling it by member?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 27 Sep 2025 16:30:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-convert-a-number-to-string-using-specific-format-For/m-p/904411#M106328</guid>
      <dc:creator>miguello</dc:creator>
      <dc:date>2025-09-27T16:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a number to string using specific format? For instance: {"Scientific", 12}</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-convert-a-number-to-string-using-specific-format-For/m-p/904414#M106329</link>
      <description>&lt;P&gt;Many unnamed arguments in Jmp are optional.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to insert the value .&lt;/P&gt;
&lt;P&gt;As an alternative you can use&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Insert (Substitute(format1,{},Expr(Format())),expr(value),1)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_1-1759001765925.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/83706iECEF10A4C9E7738B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_1-1759001765925.png" alt="hogi_1-1759001765925.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It looks much more complicated. The benefit:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Independent of the number of settings.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another approach: inverting the 2 steps&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Substitute(insert({value},format1),{},Expr(Format()))&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_2-1759001791786.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/83707iF4E7A43BD206B4A1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_2-1759001791786.png" alt="hogi_2-1759001791786.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;One of the few cases where it helps that Insert flattens the result:&lt;BR /&gt;&amp;nbsp;&lt;LI-MESSAGE title="JMP Expr() weirdness, can anyone explain?" uid="400469" url="https://community.jmp.com/t5/Discussions/JMP-Expr-weirdness-can-anyone-explain/m-p/400469#U400469" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;BR /&gt;For all the other cases, I hope Insert will get a new option ; )&lt;BR /&gt;&lt;LI-MESSAGE title="Insert Into: Flatten(0|1)" uid="748326" url="https://community.jmp.com/t5/JMP-Wish-List/Insert-Into-Flatten-0-1/m-p/748326#U748326" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-idea-thread lia-fa-icon lia-fa-idea lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 27 Sep 2025 19:37:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-convert-a-number-to-string-using-specific-format-For/m-p/904414#M106329</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2025-09-27T19:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a number to string using specific format? For instance: {"Scientific", 12}</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-convert-a-number-to-string-using-specific-format-For/m-p/904482#M106330</link>
      <description>&lt;P&gt;Have you just tried using the list of the parameters?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");

gb = dt &amp;lt;&amp;lt; Graph Builder(
	Size(525, 454),
	Show Control Panel(0),
	Variables(X(:weight), Y(:height), Overlay(:sex)),
	Elements(Points(X, Y, Legend(9)), Line Of Fit(X, Y, Legend(11))),
	SendToReport(
		Dispatch({}, "weight", ScaleBox, {Format("Scientific", 12)}),
		Dispatch({}, "height", ScaleBox, {Format("Fixed Dec", 12, 2)})
	)
);

abs = gb &amp;lt;&amp;lt; XPath("//AxisBox");
xaxis_format = abs[1] &amp;lt;&amp;lt; get format;
yaxis_format = abs[2] &amp;lt;&amp;lt; get format;

bb = 3.1415926535;
Show(Format(bb, xaxis_format)); // Format(bb, xaxis_format) = "3.1415927e+0";
Show(Format(bb, yaxis_format)); // Format(bb, yaxis_format) = "3.14";
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 28 Sep 2025 16:15:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-convert-a-number-to-string-using-specific-format-For/m-p/904482#M106330</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-09-28T16:15:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a number to string using specific format? For instance: {"Scientific", 12}</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-convert-a-number-to-string-using-specific-format-For/m-p/904537#M106335</link>
      <description>&lt;P&gt;For some reason that doesn't work in my case:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;  bb = 3.1415926535;
  Show(format2);  //format2 = {"Fixed Dec", 12, 2};
  Show(Format(bb, format2)); //Format(bb, format2) = "01/01/1904";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I'm on JMP 17.2&lt;/P&gt;</description>
      <pubDate>Mon, 29 Sep 2025 06:33:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-convert-a-number-to-string-using-specific-format-For/m-p/904537#M106335</guid>
      <dc:creator>miguello</dc:creator>
      <dc:date>2025-09-29T06:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a number to string using specific format? For instance: {"Scientific", 12}</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-convert-a-number-to-string-using-specific-format-For/m-p/904538#M106336</link>
      <description>&lt;P&gt;Ok, it might be version dependent then (I tried with JMP18/19). The sure way of doing this is using something like hogi did already demonstrate with the substitute+insert.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

f = {"Scientific", 12};
bb = 3.1415926535;

myval_format = Insert(f, bb, 1);

myval_str = Eval(Substitute(myval_format, {}, Expr(Format())));
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 Sep 2025 06:38:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-convert-a-number-to-string-using-specific-format-For/m-p/904538#M106336</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-09-29T06:38:04Z</dc:date>
    </item>
  </channel>
</rss>

