| Line | |
|---|
| 1 | /*
|
|---|
| 2 | * Copyright (c) 1999 Olaf Flebbe [email protected]
|
|---|
| 3 | *
|
|---|
| 4 | * You may distribute under the terms of either the GNU General Public
|
|---|
| 5 | * License or the Artistic License, as specified in the README file.
|
|---|
| 6 | *
|
|---|
| 7 | */
|
|---|
| 8 |
|
|---|
| 9 | /* This is C++ Code !! */
|
|---|
| 10 |
|
|---|
| 11 | #include <e32std.h>
|
|---|
| 12 | #include <stdlib.h>
|
|---|
| 13 | #include <estlib.h>
|
|---|
| 14 | #include <string.h>
|
|---|
| 15 |
|
|---|
| 16 | extern "C" {
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 | /* Workaround for defect strtoul(). Values with leading + are zero */
|
|---|
| 20 |
|
|---|
| 21 | unsigned long int epoc_strtoul(const char *nptr, char **endptr,
|
|---|
| 22 | int base) {
|
|---|
| 23 | if (nptr && *nptr == '+')
|
|---|
| 24 | nptr++;
|
|---|
| 25 | return strtoul( nptr, endptr, base);
|
|---|
| 26 | }
|
|---|
| 27 |
|
|---|
| 28 | void epoc_gcvt( double x, int digits, unsigned char *buf) {
|
|---|
| 29 | TRealFormat trel;
|
|---|
| 30 |
|
|---|
| 31 | trel.iPlaces = digits;
|
|---|
| 32 | trel.iPoint = TChar( '.');
|
|---|
| 33 |
|
|---|
| 34 | TPtr result( buf, 80);
|
|---|
| 35 |
|
|---|
| 36 | result.Num( x, trel);
|
|---|
| 37 | result.Append( TChar( 0));
|
|---|
| 38 | }
|
|---|
| 39 | }
|
|---|
| 40 |
|
|---|
| 41 |
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.