!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache. PHP/7.3.33 

uname -a: Linux web25.us.cloudlogin.co 5.10.237-xeon-hst #1 SMP Mon May 5 15:10:04 UTC 2025 x86_64 

uid=233359(alpastrology) gid=888(tty) groups=888(tty),33(tape) 

Safe-mode: OFF (not secure)

/usr/share/doc/libicu-devel/samples/numfmt/   drwxr-xr-x
Free 6181.59 GB of 6262.79 GB (98.7%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     capi.c (2.68 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/********************************************************************
 *   © 2016 and later: Unicode, Inc. and others.
 *   License & terms of use: http://www.unicode.org/copyright.html#License
 *************************************************************************
 *************************************************************************
 * COPYRIGHT:
 * Copyright (c) 1999-2002, International Business Machines Corporation and
 * others. All Rights Reserved.
 *************************************************************************/

#include "unicode/unum.h"
#include "unicode/ustring.h"
#include <stdio.h>
#include <stdlib.h>

static void uprintf(const UChar* str) {
    char buf[256];
    u_austrcpy(buf, str);
    printf("%s", buf);
}

void capi() {
    UNumberFormat *fmt;
    UErrorCode status = U_ZERO_ERROR;
    /* The string "987654321.123" as UChars */
    UChar str[] = { 0x39, 0x38, 0x37, 0x36, 0x35, 0x34, 0x33,
                    0x32, 0x31, 0x30, 0x2E, 0x31, 0x32, 0x33, 0 };
    UChar buf[256];
    int32_t needed;
    double a;
    
    /* Create a formatter for the US locale */
    fmt = unum_open(
          UNUM_DECIMAL,      /* style         */
          0,                 /* pattern       */
          0,                 /* patternLength */
          "en_US",           /* locale        */
          0,                 /* parseErr      */
          &status);
    if (U_FAILURE(status)) {
        printf("FAIL: unum_open\n");
        exit(1);
    }

    /* Use the formatter to parse a number.  When using the C API,
       we have to specify whether we want a double or a long in advance.

       We pass in NULL for the position pointer in order to get the
       default behavior which is to parse from the start. */
    a = unum_parseDouble(fmt, str, u_strlen(str), NULL, &status);
    if (U_FAILURE(status)) {
        printf("FAIL: unum_parseDouble\n");
        exit(1);
    }

    /* Show the result */
    printf("unum_parseDouble(\"");
    uprintf(str);
    printf("\") => %g\n", a);

    /* Use the formatter to format the same number back into a string
       in the US locale.  The return value is the buffer size needed.
       We're pretty sure we have enough space, but in a production
       application one would check this value.

       We pass in NULL for the UFieldPosition pointer because we don't
       care to receive that data. */
    needed = unum_formatDouble(fmt, a, buf, 256, NULL, &status);
    if (U_FAILURE(status)) {
        printf("FAIL: format_parseDouble\n");
        exit(1);
    }

    /* Show the result */
    printf("unum_formatDouble(%g) => \"", a);
    uprintf(buf);
    printf("\"\n");

    /* Release the storage used by the formatter */
    unum_close(fmt);
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.012 ]--