4 Replies Latest reply on Mar 15, 2016 11:56 PM by selvam214

    Decimal value to fraction

    selvam214 Level 1


      How to change the decimal values (inches) to fraction method, samples & screenshot here (left is tool output, right is needed method). The values need to change pica format also (Para Indent: 1p2), kindly guide on this.



      Trim: 4.1875” x 6.75”                      ==>       Trim: 4 3/16" x 6 3/4"

      Para Indent: 1.16666666666667    ==>       Para Indent: 1p2




      Screen shot 2016-03-08 at 8.46.46 PM.png




      Sample code here:


      var width = app.activeDocument.documentPreferences.pageWidth;

      var height = app.activeDocument.documentPreferences.pageHeight;

      var myTrim = "Trim: "+width+"\" x "+height+"\"\r";


      //struggle to convert decimal to fraction