View Javadoc

1   package com.sharkysoft.printf;
2   
3   import com.sharkysoft.math.MathToolbox;
4   
5   final class Formatter_g_l extends Formatter_g
6   {
7   
8     Formatter_g_l(final FormatSpecifier ipPfs)
9     {
10      super(ipPfs);
11    }
12    
13    void format(final PrintfState ipPs)
14    {
15      adjustWidthAndPrecision(ipPs);
16      if 
17      ( shouldUseScientific
18        ( MathToolbox.toScientificNotation
19          ( ((Number) ipPs.mapArgs[ipPs.mnArgIndex]).doubleValue()
20          )
21        )
22      )
23        formatDoubleScientific(ipPs);
24      else
25        formatDouble(ipPs);
26    }
27    
28  }
29