title: crystal reports conditional formatting for summary fields
body: <p>I'm trying to create a decimal formatting formula on my summary fields. The values in the database could have 0, 1, or 2 decimal places. I've started with this:</p>
  
  <pre><code>If (CurrentFieldValue mod 1 = 0) Then
              0
  Else If (CurrentFieldValue mod .1 = 0) Then
              1
  Else
              2
  </code></pre>
  
  <p>On a simple single data field, this works and displays the value with 0, 1, or 2 decimal places based on the data coming from my database. The same formula doesn't work for a summary field on my reports with group data. Any ideas?</p>
  
  <p><strong>Edit:</strong> Since I don't know how to format code in a comment, I'll address the suggestion of using a formula here:</p>
  
  <p>Didn't work. Formula:</p>
  
  <pre><code>Sum ({myTable.dataValue}, {myTable.groupField})
  </code></pre>
  
  <p>then I used:</p>
  
  <pre><code>If ({@formula} mod 1 = 0) Then
      0
  Else If ({@formula} mod .1 = 0) Then
      1
  Else
      2
  </code></pre>
  
  <p>And I still got whole numbers for everything. My rounding is set to .01 with no formula. Do I need a formula for rounding too? I still don't understand why this works on individual values but not for group summaries.</p>