Compuprint 914 Guia de Instalação Página 55

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 58
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 54
4-9
Bull S.A. May 25th, 1999
9.3.3 UTF–8: Example of a conversion program
In the following example the Euro character is coded hex e282ac.
#include <monetary.h>
#include <locale.h>
#include <stdio.h>
main(int argc, char **argv)
{
char bfr[256];
ssize_t size;
float value, cours = 6.55957;
(void) setlocale (LC_ALL, ”fr_FR.IBM–1252”);
value = 10000.00;
size = strfmon(bfr, 256, ”%+15#5.2n”, value);
printf (”valeur en Francs: %s ”, bfr);
value = 10000.00 / cours;
(void) setlocale (LC_MONETARY, ”FR_FR@euro”);
size = strfmon(bfr, 256, ”%+15#5.2n”, value);
if (size > 0)
printf (”soit en EUROS: %s\n”, bfr);
}
9.4 Usage of NLS in Cobol programs
9.4.1 IBM–1252: Example of program
This example prints the Euro character (coded hex 80) on an X terminal. It will give the Euro
character before the Euro value:
export LANG=fr_FR.IBM–1252
export LC_MONETARY=fr_FR.IBM–1252@euro
$set NLS
$set XOPEN
environment division.
special–names.
environment–name is envname
environment–value is envvalue.
data division.
01 valeur pic $$$$$$9.99.
01 lang pic x(5).
procedure division.
display ”LANG” upon envname.
accept lang from envvalue.
move 456.23 to valeur.
display ”When LANG=” lang ”, value is =” valeur ”.”.
stop run.
This procedure is only possible with float insertion or fix insertion.
To have the Euro character after its value, see the examples hereafter.
Vista de página 54
1 2 ... 50 51 52 53 54 55 56 57 58

Comentários a estes Manuais

Sem comentários