Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Hive_Milestone3/sources/HeuristicLab.Visualization/3.2/LabelProvider/DiscreteLabelProvider.cs @ 5155

Last change on this file since 5155 was 1996, checked in by mstoeger, 16 years ago

implemented IStorable and made use of the PersistenceManager wherever possible. #639

File size: 419 bytes
Line 
1using System;
2using HeuristicLab.Core;
3
4namespace HeuristicLab.Visualization.LabelProvider {
5  public class DiscreteLabelProvider : StorableBase, ILabelProvider {
6    public string GetLabel(double value) {
7      int index = (int)Math.Round(value);
8      double delta = Math.Abs(index - value);
9
10      if (delta < 1e-10)
11        return index.ToString();
12      else
13        return string.Empty;
14    }
15  }
16}
Note: See TracBrowser for help on using the repository browser.