{"id":5278,"date":"2014-03-30T20:17:16","date_gmt":"2014-03-30T20:17:16","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/how-can-i-apply-different-formats-based-on-data-values-collection-of-common-programming-errors\/"},"modified":"2014-03-30T20:17:16","modified_gmt":"2014-03-30T20:17:16","slug":"how-can-i-apply-different-formats-based-on-data-values-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/how-can-i-apply-different-formats-based-on-data-values-collection-of-common-programming-errors\/","title":{"rendered":"How Can I Apply Different Formats Based on Data Values-Collection of common programming errors"},"content":{"rendered":"<p>Your question isn&#8217;t perfectly clear, but if you want to do something like<\/p>\n<pre><code>newvar = put(oldvar,MYFMT.)\n<\/code><\/pre>\n<p>-&gt;<\/p>\n<pre><code>if x=1 then newvar=put(oldvar,MYFMT.);\nelse newvar=put(oldvar,MYFMT2.);\n<\/code><\/pre>\n<p>But without all of the if statements, you can use <code>PUTN<\/code> or <code>PUTC<\/code>, which allows you to specify the format at runtime.<\/p>\n<pre><code>newvar = putn(oldvar,fmtvar); *optionally can specify w and d as separate arguments also;\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Your question isn&#8217;t perfectly clear, but if you want to do something like newvar = put(oldvar,MYFMT.) -&gt; if x=1 then newvar=put(oldvar,MYFMT.); else newvar=put(oldvar,MYFMT2.); But without all of the if statements, you can use PUTN or PUTC, which allows you to specify the format at runtime. newvar = putn(oldvar,fmtvar); *optionally can specify w and d as [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5278","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5278","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=5278"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5278\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=5278"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=5278"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=5278"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}