~valavanisalex/ubuntu/precise/inkscape/fix-943984

« back to all changes in this revision

Viewing changes to inkscape-0.47pre1/src/io/ftos.h

  • Committer: Bazaar Package Importer
  • Author(s): Bryce Harrington
  • Date: 2009-07-02 17:09:45 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20090702170945-nn6d6zswovbwju1t
Tags: 0.47~pre1-0ubuntu1
* New upstream release.
  - Don't constrain maximization on small resolution devices (pre0)
    (LP: #348842)
  - Fixes segfault on startup (pre0)
    (LP: #391149)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/////////////////////////////////////////////////////////////////////////
 
2
//                               ftos.h
 
3
//
 
4
// Copyright (c) 1996 Bryce W. Harrington - bryce@neptune.net
 
5
//
 
6
//-----------------------------------------------------------------------
 
7
// License:  This code may be used by anyone for any purpose
 
8
//           so long as the copyright notices and this license
 
9
//           statement remains attached.
 
10
//-----------------------------------------------------------------------
 
11
// Description of file contents
 
12
// 1993 - Bryce Harrington
 
13
//    Created initial ftoa routine
 
14
//
 
15
// October 1996 - Bryce Harrington
 
16
//    Created itos from code taken from Kernighan & Ritchie
 
17
//       _The C Programming Language_ 2nd edition
 
18
//
 
19
// November 1996 - Bryce Harrington
 
20
//    Created new ftoa and ftos
 
21
//
 
22
// July 1999 - Bryce Harrington
 
23
//    Ported to Linux for use in WorldForge
 
24
//
 
25
// January 2000 - Karsten Laux klaux@rhrk.uni-kl.de
 
26
//    added ultos - convering ulong to string
 
27
//
 
28
/////////////////////////////////////////////////////////////////////////
 
29
#ifndef ftos_h
 
30
#define ftos_h
 
31
 
 
32
#include <string>
 
33
 
 
34
// ftos routine
 
35
const int FORCE_X10              = (1 << 0);
 
36
const int FORCE_DECIMAL          = (1 << 1);
 
37
const int FORCE_EXP_ZERO         = (1 << 2);
 
38
const int FORCE_HUNDRED_EXP_ZERO = (1 << 3);
 
39
const int FORCE_EXP_PLUS         = (1 << 4);
 
40
const int FORCE_EXP              = (1 << 5);
 
41
const int FORCE_PLUS             = (1 << 6);
 
42
 
 
43
///
 
44
std::string ftos(double val, char mode='g', int sigfig=-1, int precision=-1, int options=0);
 
45
///
 
46
std::string itos(int n);
 
47
///
 
48
std::string ultos(unsigned long n);
 
49
///
 
50
double rround(double x);         // use rounding rule -> x to nearest int.
 
51
///
 
52
double rround(double x, int k);  // round to the kth place
 
53
 
 
54
#endif // ftos_h