IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Forms Oracle Discussion :

convertir un montant en toutes lettres


Sujet :

Forms Oracle

  1. #1
    Membre régulier
    Inscrit en
    Octobre 2005
    Messages
    279
    Détails du profil
    Informations forums :
    Inscription : Octobre 2005
    Messages : 279
    Points : 80
    Points
    80
    Par défaut convertir un montant en toutes lettres
    bonjour,
    je veux convertir un montant (en number) à un montant en toutes lettres.

  2. #2
    Expert éminent sénior
    Avatar de SheikYerbouti
    Profil pro
    Inscrit en
    Mai 2003
    Messages
    6 760
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2003
    Messages : 6 760
    Points : 11 862
    Points
    11 862
    Par défaut
    Bonjour,

    Quelle relation avec Forms ?

  3. #3
    Membre régulier
    Inscrit en
    Octobre 2005
    Messages
    279
    Détails du profil
    Informations forums :
    Inscription : Octobre 2005
    Messages : 279
    Points : 80
    Points
    80
    Par défaut
    Citation Envoyé par SheikYerbouti Voir le message
    Bonjour,

    Quelle relation avec Forms ?
    bon, je vais l'utiliser en forms
    mais je veux une procedure sql ou pl sql

  4. #4
    Expert éminent sénior
    Avatar de SheikYerbouti
    Profil pro
    Inscrit en
    Mai 2003
    Messages
    6 760
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2003
    Messages : 6 760
    Points : 11 862
    Points
    11 862
    Par défaut
    recherchez dans la FAQ PL/SQL. je crois qu'il existe une entrée dans ce sens.

  5. #5
    Expert éminent sénior
    Avatar de orafrance
    Profil pro
    Inscrit en
    Janvier 2004
    Messages
    15 967
    Détails du profil
    Informations personnelles :
    Âge : 47
    Localisation : France

    Informations forums :
    Inscription : Janvier 2004
    Messages : 15 967
    Points : 19 075
    Points
    19 075

  6. #6
    Membre régulier
    Inscrit en
    Octobre 2005
    Messages
    279
    Détails du profil
    Informations forums :
    Inscription : Octobre 2005
    Messages : 279
    Points : 80
    Points
    80
    Par défaut
    merci mais quand je fais
    SELECT translate_fr(to_word_en(7480.230)) FROM dual;
    il m'affiche sept mille quatre cent quatre-vingts vingt-trois

    et moi je veux afficher
    sept mille quatre cent quatre-vingts deux cent-trente

    aussi je veux que la procedure accepte les virgules et non les points

    et merci infiniment

  7. #7
    Expert éminent sénior
    Avatar de orafrance
    Profil pro
    Inscrit en
    Janvier 2004
    Messages
    15 967
    Détails du profil
    Informations personnelles :
    Âge : 47
    Localisation : France

    Informations forums :
    Inscription : Janvier 2004
    Messages : 15 967
    Points : 19 075
    Points
    19 075
    Par défaut
    Il te suffit d'adapter le code pour prendre un VARCHAR à la place d'un NUMBER

    Essaye :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    CREATE OR REPLACE FUNCTION nb_en_lettre(pv$nombre IN VARCHAR) 
       RETURN VARCHAR2 
    AS 
       ln$entier           NUMBER := TO_NUMBER(SUBSTR(pv$nombre,1,INSTR(pv$nombre,',')-1));
       ln$decimales        VARCHAR2 (255) := TO_NUMBER(SUBSTR(pv$nombre,INSTR(pv$nombre,',')+1)); 
    BEGIN
    RETURN translate_fr(to_word_en(ln$entier))|| ' ' || translate_fr(to_word_en(ln$decimales));
    END;
    /
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    SQL> select nb_en_lettre('7480,230') from dual;
     
    NB_EN_LETTRE('7480,230')
    --------------------------------------------------------------------------------
    sept mille quatre cent quatre-vingts deux cent trente

  8. #8
    Membre régulier
    Inscrit en
    Octobre 2005
    Messages
    279
    Détails du profil
    Informations forums :
    Inscription : Octobre 2005
    Messages : 279
    Points : 80
    Points
    80
    Par défaut
    Citation Envoyé par orafrance Voir le message
    Il te suffit d'adapter le code pour prendre un VARCHAR à la place d'un NUMBER

    Essaye :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    CREATE OR REPLACE FUNCTION nb_en_lettre(pv$nombre IN VARCHAR) 
       RETURN VARCHAR2 
    AS 
       ln$entier           NUMBER := TO_NUMBER(SUBSTR(pv$nombre,1,INSTR(pv$nombre,',')-1));
       ln$decimales        VARCHAR2 (255) := TO_NUMBER(SUBSTR(pv$nombre,INSTR(pv$nombre,',')+1)); 
    BEGIN
    RETURN translate_fr(to_word_en(ln$entier))|| ' ' || translate_fr(to_word_en(ln$decimales));
    END;
    /
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    SQL> select nb_en_lettre('7480,230') from dual;
     
    NB_EN_LETTRE('7480,230')
    --------------------------------------------------------------------------------
    sept mille quatre cent quatre-vingts deux cent trente


    merci beucoup
    mais j'ai un autre petit probleme
    quand j'ai un montant de 7 480,300 et qui est stocké dans la base 7480,3
    en principe il m'affiche
    sept milleS quatre centS quatre-vingts DINARS trois centS MILLIMES
    mais il m'affiche
    sept mille quatre cent quatre-vingts DINARS trois MILLIMES

    aussi tu remarques que le 'S' du CENTS n'est pas affiché

  9. #9
    Membre régulier
    Inscrit en
    Octobre 2005
    Messages
    279
    Détails du profil
    Informations forums :
    Inscription : Octobre 2005
    Messages : 279
    Points : 80
    Points
    80
    Par défaut
    Citation Envoyé par orafrance Voir le message
    Il te suffit d'adapter le code pour prendre un VARCHAR à la place d'un NUMBER

    Essaye :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    CREATE OR REPLACE FUNCTION nb_en_lettre(pv$nombre IN VARCHAR) 
       RETURN VARCHAR2 
    AS 
       ln$entier           NUMBER := TO_NUMBER(SUBSTR(pv$nombre,1,INSTR(pv$nombre,',')-1));
       ln$decimales        VARCHAR2 (255) := TO_NUMBER(SUBSTR(pv$nombre,INSTR(pv$nombre,',')+1)); 
    BEGIN
    RETURN translate_fr(to_word_en(ln$entier))|| ' ' || translate_fr(to_word_en(ln$decimales));
    END;
    /
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    SQL> select nb_en_lettre('7480,230') from dual;
     
    NB_EN_LETTRE('7480,230')
    --------------------------------------------------------------------------------
    sept mille quatre cent quatre-vingts deux cent trente
    aussi quand j'essaye
    SELECT NB_EN_LETTRE('301000,000') FROM dual;
    il maffiche
    TROIS CENT MILLE DINARS ZERO MILLIMES
    au lieu de
    TROIS CENT UN MILLE DINARS ZERO MILLIMES

  10. #10
    Expert éminent sénior
    Avatar de orafrance
    Profil pro
    Inscrit en
    Janvier 2004
    Messages
    15 967
    Détails du profil
    Informations personnelles :
    Âge : 47
    Localisation : France

    Informations forums :
    Inscription : Janvier 2004
    Messages : 15 967
    Points : 19 075
    Points
    19 075
    Par défaut
    c'est un bug, essaye avec :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    CREATE OR REPLACE FUNCTION translate_fr(pn$nombre_en in varchar2) 
    RETURN VARCHAR2 
    AS 
    BEGIN 
        RETURN REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE(REPLACE(
                                                    pn$nombre_en 
                                                  , 'million'           , 'millions'        ) 
                                                  , 'billion'           , 'milliards'       ) 
                                               , 'trillion'          , 'trillions'       ) 
                                               , 'quadrillion'       , 'quadrillions'    ) 
                                                  , 'quintillion'       , 'cintillions'     ) 
                                               , 'sextillion'        , 'sextillions'     )    
                                               , 'septillion'        , 'septillions'     )  
                                               , 'octillion'         , 'octillions'      ) 
                                               , 'nonillion'         , 'nonillions'      )  
                                               , 'decillion'         , 'decillions'      )  
                                               , 'undecillion'       , 'undecillions'    )  
                                               , 'duodecillion'      , 'duodecillions'   )  
                                               , 'tridecillion'      , 'tridecillions'   )  
                                               , 'quaddecillion'     , 'quaddecillions'  )  
                                               , 'quindecillion'     , 'quindecillions'  )  
                                               , 'sexdecillion'      , 'sexdecillions'   )  
                                               , 'septdecillion'     , 'septdecillions'  )  
                                               , 'octdecillion'      , 'octdecillions'   )  
                                               , 'nondecillion'      , 'nondecillions'   )  
                                               , 'dedecillion'       , 'dedecillions'    )  
                                                  , 'thousand'          , 'mille'           ) 
                                                  , 'hundred'           , 'cent'            ) 
                                                  , 'ninety'            , 'quatre-vingt-dix') 
                                                  , 'eighty'            , 'quatre-vingts'   ) 
                                                  , 'seventy'           , 'soixante-dix'    ) 
                                                  , 'sixty'             , 'soixante'        ) 
                                                  , 'fifty'             , 'cinquante'       ) 
                                                  , 'forty'             , 'quarante'        ) 
                                                  , 'thirty'            , 'trente'          ) 
                                                  , 'twenty'            , 'vingt'           ) 
                                                  , 'nineteen'          , 'dix-neuf'        ) 
                                                  , 'eighteen'          , 'dix-huit'        ) 
                                                  , 'seventeen'         , 'dix-sept'        ) 
                                                  , 'sixteen'           , 'seize'           ) 
                                                  , 'fifteen'           , 'quinze'          ) 
                                                  , 'fourteen'          , 'quatorze'        ) 
                                                  , 'thirteen'          , 'treize'          ) 
                                                  , 'twelve'            , 'douze'           ) 
                                                  , 'eleven'            , 'onze'            ) 
                                                  , 'ten'               , 'dix'             ) 
                                                  , 'nine'              , 'neuf'            ) 
                                                  , 'eight'             , 'huit'            ) 
                                                  , 'seven'             , 'sept'            ) 
                                                  , 'five'              , 'cinq'            ) 
                                                  , 'four'              , 'quatre'          ) 
                                                  , 'three'             , 'trois'           ) 
                                                  , 'two'               , 'deux'            ) 
                                                  , 'one'               , 'un'              ) 
                                                  , 'dix-six'           , 'seize'           ) 
                                                  , 'dix-cinq'          , 'quinze'          ) 
                                                  , 'dix-quatre'        , 'quatorze'        ) 
                                                  , 'dix-trois'         , 'treize'          ) 
                                                  , 'dix-deux'          , 'douze'           ) 
                                                  , 'dix-un'            , 'onze'            ) 
                                                  , '-un '              , '-une '           ) 
                                                  , 'un cent'           , 'cent'            ) 
                                                  , 'un mille'          , 'mille'           ) 
                                                  , 'une'               , 'un'              ) 
                                                  , 'soixante-onze'     , 'soixante et onze') 
                                                  , 'quatre-vingts-'    , 'quatre-vingt-'   ) 
                                                  , '-un'               , ' et un'          ) 
                                                  , 'quatre-vingt et un', 'quatre-vingt-un' ) 
                                                  , 'deux cent'         , 'deux cents'      ) 
                                                  , 'trois cent'        , 'trois cents'     ) 
                                                  , 'quatre cent'       , 'quatre cents'    ) 
                                                  , 'cinq cent'         , 'cinq cents'      ) 
                                                  , 'six cent'          , 'six cents'       ) 
                                                  , 'sept cent'         , 'sept cents'      ) 
                                                  , 'huit cent'         , 'huit cents'      ) 
                                                  , 'neuf cent'         , 'neuf cents'      ) 
                                                  , 'cents '            , 'cent '           ) 
                                                  , ' mille'       , ' un mille'      ) 
                                                  , 'un millions'       , 'un million'      ) 
                                                  , 'un bidecillions'   , 'un bidecillion'  ) 
                                                  , 'un cintillions'    , 'un cintillion'   ) 
                                                  , 'un milliards'      , 'un milliard'     ) 
                                               , 'un trillions'      , 'un trillion'      ) 
                                               , 'un quadrillions'   , 'un quadrillion'   ) 
                                               , 'un sextillions'    , 'un sextillion'    )    
                                               , 'un septillions'    , 'un septillion'    )  
                                               , 'un octillions'     , 'un octillion'     ) 
                                               , 'un nonillions'     , 'un nonillion'     )  
                                               , 'un decillions'     , 'un decillion'     )  
                                               , 'un undecillions'   , 'un undecillion'   )  
                                       , 'un duodecillions'  , 'un duodecillion'  )  
                                               , 'un tridecillions'  , 'un tridecillion'  )  
                                               , 'un quaddecillions' , 'un quaddecillion' )  
                                               , 'un quindecillions' , 'un quindecillion' )  
                                               , 'un sexdecillions'  , 'un sexdecillion'  )  
                                               , 'un septdecillions' , 'un septdecillion' )  
                                               , 'un octdecillions'  , 'un octdecillion'  )  
                                               , 'un nondecillions'  , 'un nondecillion'  )  
                                               , 'un dedecillions'   , 'un dedecillion'   )  
                                               , '-un trillion'      , '-un trillions'     ) 
                                               , '-un quadrillion'   , '-un quadrillions'  ) 
                                               , '-un sextillion'    , '-un sextillions'   )    
                                               , '-un septillion'    , '-un septillions'   )  
                                               , '-un octillion'     , '-un octillions'    ) 
                                               , '-un nonillion'     , '-un nonillions'    )  
                                               , '-un decillion'     , '-un decillions'    )  
                                               , '-un undecillion'   , '-un undecillions'  )  
                                               , '-un duodecillion'  , '-un duodecillions' )  
                                               , '-un tridecillion'  , '-un tridecillions' )  
                                               , '-un quaddecillion' , '-un quaddecillions')  
                                               , '-un quindecillion' , '-un quindecillions')  
                                               , '-un sexdecillion'  , '-un sexdecillions' )  
                                               , '-un septdecillion' , '-un septdecillions')  
                                               , '-un octdecillion'  , '-un octdecillions' )  
                                               , '-un nondecillion'  , '-un nondecillions' )  
                                               , '-un dedecillion'   , '-un dedecillions'  )  
                                                  , '-un million'       , '-un millions'    ) 
                                                  , '-un bidecillion'   , '-un bidecillions') 
                                                  , '-un cintillion'    , '-un cintillions' ) 
                                                  , '-un milliard'      , '-un milliards'   ) 
                                                  , 'point'             , 'virgule'         ) 
    					     ,'  ',' ')
                              ; 
    END translate_fr; 
    /
    j'ai ajouté 2 REPLACE :
    , ' mille' , ' un mille' pour ajouter un si mille n'est pas le premier mot (si il est précédé d'un espace)
    ,' ',' ' pour supprimer les espaces en trop

  11. #11
    Membre régulier
    Inscrit en
    Octobre 2005
    Messages
    279
    Détails du profil
    Informations forums :
    Inscription : Octobre 2005
    Messages : 279
    Points : 80
    Points
    80
    Par défaut
    Citation Envoyé par orafrance Voir le message
    c'est un bug, essaye avec :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    CREATE OR REPLACE FUNCTION translate_fr(pn$nombre_en in varchar2) 
    RETURN VARCHAR2 
    AS 
    BEGIN 
        RETURN REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE(REPLACE(
                                                    pn$nombre_en 
                                                  , 'million'           , 'millions'        ) 
                                                  , 'billion'           , 'milliards'       ) 
                                               , 'trillion'          , 'trillions'       ) 
                                               , 'quadrillion'       , 'quadrillions'    ) 
                                                  , 'quintillion'       , 'cintillions'     ) 
                                               , 'sextillion'        , 'sextillions'     )    
                                               , 'septillion'        , 'septillions'     )  
                                               , 'octillion'         , 'octillions'      ) 
                                               , 'nonillion'         , 'nonillions'      )  
                                               , 'decillion'         , 'decillions'      )  
                                               , 'undecillion'       , 'undecillions'    )  
                                               , 'duodecillion'      , 'duodecillions'   )  
                                               , 'tridecillion'      , 'tridecillions'   )  
                                               , 'quaddecillion'     , 'quaddecillions'  )  
                                               , 'quindecillion'     , 'quindecillions'  )  
                                               , 'sexdecillion'      , 'sexdecillions'   )  
                                               , 'septdecillion'     , 'septdecillions'  )  
                                               , 'octdecillion'      , 'octdecillions'   )  
                                               , 'nondecillion'      , 'nondecillions'   )  
                                               , 'dedecillion'       , 'dedecillions'    )  
                                                  , 'thousand'          , 'mille'           ) 
                                                  , 'hundred'           , 'cent'            ) 
                                                  , 'ninety'            , 'quatre-vingt-dix') 
                                                  , 'eighty'            , 'quatre-vingts'   ) 
                                                  , 'seventy'           , 'soixante-dix'    ) 
                                                  , 'sixty'             , 'soixante'        ) 
                                                  , 'fifty'             , 'cinquante'       ) 
                                                  , 'forty'             , 'quarante'        ) 
                                                  , 'thirty'            , 'trente'          ) 
                                                  , 'twenty'            , 'vingt'           ) 
                                                  , 'nineteen'          , 'dix-neuf'        ) 
                                                  , 'eighteen'          , 'dix-huit'        ) 
                                                  , 'seventeen'         , 'dix-sept'        ) 
                                                  , 'sixteen'           , 'seize'           ) 
                                                  , 'fifteen'           , 'quinze'          ) 
                                                  , 'fourteen'          , 'quatorze'        ) 
                                                  , 'thirteen'          , 'treize'          ) 
                                                  , 'twelve'            , 'douze'           ) 
                                                  , 'eleven'            , 'onze'            ) 
                                                  , 'ten'               , 'dix'             ) 
                                                  , 'nine'              , 'neuf'            ) 
                                                  , 'eight'             , 'huit'            ) 
                                                  , 'seven'             , 'sept'            ) 
                                                  , 'five'              , 'cinq'            ) 
                                                  , 'four'              , 'quatre'          ) 
                                                  , 'three'             , 'trois'           ) 
                                                  , 'two'               , 'deux'            ) 
                                                  , 'one'               , 'un'              ) 
                                                  , 'dix-six'           , 'seize'           ) 
                                                  , 'dix-cinq'          , 'quinze'          ) 
                                                  , 'dix-quatre'        , 'quatorze'        ) 
                                                  , 'dix-trois'         , 'treize'          ) 
                                                  , 'dix-deux'          , 'douze'           ) 
                                                  , 'dix-un'            , 'onze'            ) 
                                                  , '-un '              , '-une '           ) 
                                                  , 'un cent'           , 'cent'            ) 
                                                  , 'un mille'          , 'mille'           ) 
                                                  , 'une'               , 'un'              ) 
                                                  , 'soixante-onze'     , 'soixante et onze') 
                                                  , 'quatre-vingts-'    , 'quatre-vingt-'   ) 
                                                  , '-un'               , ' et un'          ) 
                                                  , 'quatre-vingt et un', 'quatre-vingt-un' ) 
                                                  , 'deux cent'         , 'deux cents'      ) 
                                                  , 'trois cent'        , 'trois cents'     ) 
                                                  , 'quatre cent'       , 'quatre cents'    ) 
                                                  , 'cinq cent'         , 'cinq cents'      ) 
                                                  , 'six cent'          , 'six cents'       ) 
                                                  , 'sept cent'         , 'sept cents'      ) 
                                                  , 'huit cent'         , 'huit cents'      ) 
                                                  , 'neuf cent'         , 'neuf cents'      ) 
                                                  , 'cents '            , 'cent '           ) 
                                                  , ' mille'       , ' un mille'      ) 
                                                  , 'un millions'       , 'un million'      ) 
                                                  , 'un bidecillions'   , 'un bidecillion'  ) 
                                                  , 'un cintillions'    , 'un cintillion'   ) 
                                                  , 'un milliards'      , 'un milliard'     ) 
                                               , 'un trillions'      , 'un trillion'      ) 
                                               , 'un quadrillions'   , 'un quadrillion'   ) 
                                               , 'un sextillions'    , 'un sextillion'    )    
                                               , 'un septillions'    , 'un septillion'    )  
                                               , 'un octillions'     , 'un octillion'     ) 
                                               , 'un nonillions'     , 'un nonillion'     )  
                                               , 'un decillions'     , 'un decillion'     )  
                                               , 'un undecillions'   , 'un undecillion'   )  
                                       , 'un duodecillions'  , 'un duodecillion'  )  
                                               , 'un tridecillions'  , 'un tridecillion'  )  
                                               , 'un quaddecillions' , 'un quaddecillion' )  
                                               , 'un quindecillions' , 'un quindecillion' )  
                                               , 'un sexdecillions'  , 'un sexdecillion'  )  
                                               , 'un septdecillions' , 'un septdecillion' )  
                                               , 'un octdecillions'  , 'un octdecillion'  )  
                                               , 'un nondecillions'  , 'un nondecillion'  )  
                                               , 'un dedecillions'   , 'un dedecillion'   )  
                                               , '-un trillion'      , '-un trillions'     ) 
                                               , '-un quadrillion'   , '-un quadrillions'  ) 
                                               , '-un sextillion'    , '-un sextillions'   )    
                                               , '-un septillion'    , '-un septillions'   )  
                                               , '-un octillion'     , '-un octillions'    ) 
                                               , '-un nonillion'     , '-un nonillions'    )  
                                               , '-un decillion'     , '-un decillions'    )  
                                               , '-un undecillion'   , '-un undecillions'  )  
                                               , '-un duodecillion'  , '-un duodecillions' )  
                                               , '-un tridecillion'  , '-un tridecillions' )  
                                               , '-un quaddecillion' , '-un quaddecillions')  
                                               , '-un quindecillion' , '-un quindecillions')  
                                               , '-un sexdecillion'  , '-un sexdecillions' )  
                                               , '-un septdecillion' , '-un septdecillions')  
                                               , '-un octdecillion'  , '-un octdecillions' )  
                                               , '-un nondecillion'  , '-un nondecillions' )  
                                               , '-un dedecillion'   , '-un dedecillions'  )  
                                                  , '-un million'       , '-un millions'    ) 
                                                  , '-un bidecillion'   , '-un bidecillions') 
                                                  , '-un cintillion'    , '-un cintillions' ) 
                                                  , '-un milliard'      , '-un milliards'   ) 
                                                  , 'point'             , 'virgule'         ) 
    					     ,'  ',' ')
                              ; 
    END translate_fr; 
    /
    j'ai ajouté 2 REPLACE :
    , ' mille' , ' un mille' pour ajouter un si mille n'est pas le premier mot (si il est précédé d'un espace)
    ,' ',' ' pour supprimer les espaces en trop

    maintenant
    301000 et 300000 donnent
    TROIS CENT UN MILLE DINARS ZERO MILLIMES

  12. #12
    Expert éminent sénior
    Avatar de orafrance
    Profil pro
    Inscrit en
    Janvier 2004
    Messages
    15 967
    Détails du profil
    Informations personnelles :
    Âge : 47
    Localisation : France

    Informations forums :
    Inscription : Janvier 2004
    Messages : 15 967
    Points : 19 075
    Points
    19 075
    Par défaut
    argh... j'vais voir ça

  13. #13
    Expert éminent sénior
    Avatar de orafrance
    Profil pro
    Inscrit en
    Janvier 2004
    Messages
    15 967
    Détails du profil
    Informations personnelles :
    Âge : 47
    Localisation : France

    Informations forums :
    Inscription : Janvier 2004
    Messages : 15 967
    Points : 19 075
    Points
    19 075
    Par défaut
    Voila qui devrait aller :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    CREATE OR REPLACE FUNCTION translate_fr(pn$nombre_en IN varchar2) 
    RETURN VARCHAR2 
    AS 
    lv$nombre_fr VARCHAR2(32000);
    BEGIN 
        lv$nombre_fr := REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( 
                                                    pn$nombre_en 
                                                  , 'million'           , 'millions'        ) 
                                                  , 'billion'           , 'milliards'       ) 
                                               , 'trillion'          , 'trillions'       ) 
                                               , 'quadrillion'       , 'quadrillions'    ) 
                                                  , 'quintillion'       , 'cintillions'     ) 
                                               , 'sextillion'        , 'sextillions'     )    
                                               , 'septillion'        , 'septillions'     )  
                                               , 'octillion'         , 'octillions'      ) 
                                               , 'nonillion'         , 'nonillions'      )  
                                               , 'decillion'         , 'decillions'      )  
                                               , 'undecillion'       , 'undecillions'    )  
                                               , 'duodecillion'      , 'duodecillions'   )  
                                               , 'tridecillion'      , 'tridecillions'   )  
                                               , 'quaddecillion'     , 'quaddecillions'  )  
                                               , 'quindecillion'     , 'quindecillions'  )  
                                               , 'sexdecillion'      , 'sexdecillions'   )  
                                               , 'septdecillion'     , 'septdecillions'  )  
                                               , 'octdecillion'      , 'octdecillions'   )  
                                               , 'nondecillion'      , 'nondecillions'   )  
                                               , 'dedecillion'       , 'dedecillions'    )  
                                                  , 'thousand'          , 'mille'           ) 
                                                  , 'hundred'           , 'cent'            ) 
                                                  , 'ninety'            , 'quatre-vingt-dix') 
                                                  , 'eighty'            , 'quatre-vingts'   ) 
                                                  , 'seventy'           , 'soixante-dix'    ) 
                                                  , 'sixty'             , 'soixante'        ) 
                                                  , 'fifty'             , 'cinquante'       ) 
                                                  , 'forty'             , 'quarante'        ) 
                                                  , 'thirty'            , 'trente'          ) 
                                                  , 'twenty'            , 'vingt'           ) 
                                                  , 'nineteen'          , 'dix-neuf'        ) 
                                                  , 'eighteen'          , 'dix-huit'        ) 
                                                  , 'seventeen'         , 'dix-sept'        ) 
                                                  , 'sixteen'           , 'seize'           ) 
                                                  , 'fifteen'           , 'quinze'          ) 
                                                  , 'fourteen'          , 'quatorze'        ) 
                                                  , 'thirteen'          , 'treize'          ) 
                                                  , 'twelve'            , 'douze'           ) 
                                                  , 'eleven'            , 'onze'            ) 
                                                  , 'ten'               , 'dix'             ) 
                                                  , 'nine'              , 'neuf'            ) 
                                                  , 'eight'             , 'huit'            ) 
                                                  , 'seven'             , 'sept'            ) 
                                                  , 'five'              , 'cinq'            ) 
                                                  , 'four'              , 'quatre'          ) 
                                                  , 'three'             , 'trois'           ) 
                                                  , 'two'               , 'deux'            ) 
                                                  , 'one'               , 'un'              ) 
                                                  , 'dix-six'           , 'seize'           ) 
                                                  , 'dix-cinq'          , 'quinze'          ) 
                                                  , 'dix-quatre'        , 'quatorze'        ) 
                                                  , 'dix-trois'         , 'treize'          ) 
                                                  , 'dix-deux'          , 'douze'           ) 
                                                  , 'dix-un'            , 'onze'            ) 
                                                  , '-un '              , '-une '           ) 
                                                  , 'un cent'           , 'cent'            ) 
                                                  , 'une'               , 'un'              ) 
                                                  , 'soixante-onze'     , 'soixante et onze') 
                                                  , 'quatre-vingts-'    , 'quatre-vingt-'   ) 
                                                  , '-un'               , ' et un'          ) 
                                                  , 'quatre-vingt et un', 'quatre-vingt-un' ) 
                                                  , 'deux cent'         , 'deux cents'      ) 
                                                  , 'trois cent'        , 'trois cents'     ) 
                                                  , 'quatre cent'       , 'quatre cents'    ) 
                                                  , 'cinq cent'         , 'cinq cents'      ) 
                                                  , 'six cent'          , 'six cents'       ) 
                                                  , 'sept cent'         , 'sept cents'      ) 
                                                  , 'huit cent'         , 'huit cents'      ) 
                                                  , 'neuf cent'         , 'neuf cents'      ) 
                                                  , 'cents '            , 'cent '           ) 
                                                  , 'un millions'       , 'un million'      ) 
                                                  , 'un bidecillions'   , 'un bidecillion'  ) 
                                                  , 'un cintillions'    , 'un cintillion'   ) 
                                                  , 'un milliards'      , 'un milliard'     ) 
                                               , 'un trillions'      , 'un trillion'      ) 
                                               , 'un quadrillions'   , 'un quadrillion'   ) 
                                               , 'un sextillions'    , 'un sextillion'    )    
                                               , 'un septillions'    , 'un septillion'    )  
                                               , 'un octillions'     , 'un octillion'     ) 
                                               , 'un nonillions'     , 'un nonillion'     )  
                                               , 'un decillions'     , 'un decillion'     )  
                                               , 'un undecillions'   , 'un undecillion'   )  
                                       , 'un duodecillions'  , 'un duodecillion'  )  
                                               , 'un tridecillions'  , 'un tridecillion'  )  
                                               , 'un quaddecillions' , 'un quaddecillion' )  
                                               , 'un quindecillions' , 'un quindecillion' )  
                                               , 'un sexdecillions'  , 'un sexdecillion'  )  
                                               , 'un septdecillions' , 'un septdecillion' )  
                                               , 'un octdecillions'  , 'un octdecillion'  )  
                                               , 'un nondecillions'  , 'un nondecillion'  )  
                                               , 'un dedecillions'   , 'un dedecillion'   )  
                                               , '-un trillion'      , '-un trillions'     ) 
                                               , '-un quadrillion'   , '-un quadrillions'  ) 
                                               , '-un sextillion'    , '-un sextillions'   )    
                                               , '-un septillion'    , '-un septillions'   )  
                                               , '-un octillion'     , '-un octillions'    ) 
                                               , '-un nonillion'     , '-un nonillions'    )  
                                               , '-un decillion'     , '-un decillions'    )  
                                               , '-un undecillion'   , '-un undecillions'  )  
                                               , '-un duodecillion'  , '-un duodecillions' )  
                                               , '-un tridecillion'  , '-un tridecillions' )  
                                               , '-un quaddecillion' , '-un quaddecillions')  
                                               , '-un quindecillion' , '-un quindecillions')  
                                               , '-un sexdecillion'  , '-un sexdecillions' )  
                                               , '-un septdecillion' , '-un septdecillions')  
                                               , '-un octdecillion'  , '-un octdecillions' )  
                                               , '-un nondecillion'  , '-un nondecillions' )  
                                               , '-un dedecillion'   , '-un dedecillions'  )  
                                                  , '-un million'       , '-un millions'    ) 
                                                  , '-un bidecillion'   , '-un bidecillions') 
                                                  , '-un cintillion'    , '-un cintillions' ) 
                                                  , '-un milliard'      , '-un milliards'   ) 
                                                  , 'point'             , 'virgule'         ) 
    					     ,'  ',' '); 
     
        IF SUBSTR(lv$nombre_fr,1,8)='un mille' THEN
    	  lv$nombre_fr := SUBSTR(lv$nombre_fr,4);
    	END IF;
     
        RETURN lv$nombre_fr;
    END translate_fr; 
    /

  14. #14
    Membre régulier
    Inscrit en
    Octobre 2005
    Messages
    279
    Détails du profil
    Informations forums :
    Inscription : Octobre 2005
    Messages : 279
    Points : 80
    Points
    80
    Par défaut
    Citation Envoyé par orafrance Voir le message
    Voila qui devrait aller :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    CREATE OR REPLACE FUNCTION translate_fr(pn$nombre_en IN varchar2) 
    RETURN VARCHAR2 
    AS 
    lv$nombre_fr VARCHAR2(32000);
    BEGIN 
        lv$nombre_fr := REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( 
               REPLACE( REPLACE( REPLACE( REPLACE( 
                                                    pn$nombre_en 
                                                  , 'million'           , 'millions'        ) 
                                                  , 'billion'           , 'milliards'       ) 
                                               , 'trillion'          , 'trillions'       ) 
                                               , 'quadrillion'       , 'quadrillions'    ) 
                                                  , 'quintillion'       , 'cintillions'     ) 
                                               , 'sextillion'        , 'sextillions'     )    
                                               , 'septillion'        , 'septillions'     )  
                                               , 'octillion'         , 'octillions'      ) 
                                               , 'nonillion'         , 'nonillions'      )  
                                               , 'decillion'         , 'decillions'      )  
                                               , 'undecillion'       , 'undecillions'    )  
                                               , 'duodecillion'      , 'duodecillions'   )  
                                               , 'tridecillion'      , 'tridecillions'   )  
                                               , 'quaddecillion'     , 'quaddecillions'  )  
                                               , 'quindecillion'     , 'quindecillions'  )  
                                               , 'sexdecillion'      , 'sexdecillions'   )  
                                               , 'septdecillion'     , 'septdecillions'  )  
                                               , 'octdecillion'      , 'octdecillions'   )  
                                               , 'nondecillion'      , 'nondecillions'   )  
                                               , 'dedecillion'       , 'dedecillions'    )  
                                                  , 'thousand'          , 'mille'           ) 
                                                  , 'hundred'           , 'cent'            ) 
                                                  , 'ninety'            , 'quatre-vingt-dix') 
                                                  , 'eighty'            , 'quatre-vingts'   ) 
                                                  , 'seventy'           , 'soixante-dix'    ) 
                                                  , 'sixty'             , 'soixante'        ) 
                                                  , 'fifty'             , 'cinquante'       ) 
                                                  , 'forty'             , 'quarante'        ) 
                                                  , 'thirty'            , 'trente'          ) 
                                                  , 'twenty'            , 'vingt'           ) 
                                                  , 'nineteen'          , 'dix-neuf'        ) 
                                                  , 'eighteen'          , 'dix-huit'        ) 
                                                  , 'seventeen'         , 'dix-sept'        ) 
                                                  , 'sixteen'           , 'seize'           ) 
                                                  , 'fifteen'           , 'quinze'          ) 
                                                  , 'fourteen'          , 'quatorze'        ) 
                                                  , 'thirteen'          , 'treize'          ) 
                                                  , 'twelve'            , 'douze'           ) 
                                                  , 'eleven'            , 'onze'            ) 
                                                  , 'ten'               , 'dix'             ) 
                                                  , 'nine'              , 'neuf'            ) 
                                                  , 'eight'             , 'huit'            ) 
                                                  , 'seven'             , 'sept'            ) 
                                                  , 'five'              , 'cinq'            ) 
                                                  , 'four'              , 'quatre'          ) 
                                                  , 'three'             , 'trois'           ) 
                                                  , 'two'               , 'deux'            ) 
                                                  , 'one'               , 'un'              ) 
                                                  , 'dix-six'           , 'seize'           ) 
                                                  , 'dix-cinq'          , 'quinze'          ) 
                                                  , 'dix-quatre'        , 'quatorze'        ) 
                                                  , 'dix-trois'         , 'treize'          ) 
                                                  , 'dix-deux'          , 'douze'           ) 
                                                  , 'dix-un'            , 'onze'            ) 
                                                  , '-un '              , '-une '           ) 
                                                  , 'un cent'           , 'cent'            ) 
                                                  , 'une'               , 'un'              ) 
                                                  , 'soixante-onze'     , 'soixante et onze') 
                                                  , 'quatre-vingts-'    , 'quatre-vingt-'   ) 
                                                  , '-un'               , ' et un'          ) 
                                                  , 'quatre-vingt et un', 'quatre-vingt-un' ) 
                                                  , 'deux cent'         , 'deux cents'      ) 
                                                  , 'trois cent'        , 'trois cents'     ) 
                                                  , 'quatre cent'       , 'quatre cents'    ) 
                                                  , 'cinq cent'         , 'cinq cents'      ) 
                                                  , 'six cent'          , 'six cents'       ) 
                                                  , 'sept cent'         , 'sept cents'      ) 
                                                  , 'huit cent'         , 'huit cents'      ) 
                                                  , 'neuf cent'         , 'neuf cents'      ) 
                                                  , 'cents '            , 'cent '           ) 
                                                  , 'un millions'       , 'un million'      ) 
                                                  , 'un bidecillions'   , 'un bidecillion'  ) 
                                                  , 'un cintillions'    , 'un cintillion'   ) 
                                                  , 'un milliards'      , 'un milliard'     ) 
                                               , 'un trillions'      , 'un trillion'      ) 
                                               , 'un quadrillions'   , 'un quadrillion'   ) 
                                               , 'un sextillions'    , 'un sextillion'    )    
                                               , 'un septillions'    , 'un septillion'    )  
                                               , 'un octillions'     , 'un octillion'     ) 
                                               , 'un nonillions'     , 'un nonillion'     )  
                                               , 'un decillions'     , 'un decillion'     )  
                                               , 'un undecillions'   , 'un undecillion'   )  
                                       , 'un duodecillions'  , 'un duodecillion'  )  
                                               , 'un tridecillions'  , 'un tridecillion'  )  
                                               , 'un quaddecillions' , 'un quaddecillion' )  
                                               , 'un quindecillions' , 'un quindecillion' )  
                                               , 'un sexdecillions'  , 'un sexdecillion'  )  
                                               , 'un septdecillions' , 'un septdecillion' )  
                                               , 'un octdecillions'  , 'un octdecillion'  )  
                                               , 'un nondecillions'  , 'un nondecillion'  )  
                                               , 'un dedecillions'   , 'un dedecillion'   )  
                                               , '-un trillion'      , '-un trillions'     ) 
                                               , '-un quadrillion'   , '-un quadrillions'  ) 
                                               , '-un sextillion'    , '-un sextillions'   )    
                                               , '-un septillion'    , '-un septillions'   )  
                                               , '-un octillion'     , '-un octillions'    ) 
                                               , '-un nonillion'     , '-un nonillions'    )  
                                               , '-un decillion'     , '-un decillions'    )  
                                               , '-un undecillion'   , '-un undecillions'  )  
                                               , '-un duodecillion'  , '-un duodecillions' )  
                                               , '-un tridecillion'  , '-un tridecillions' )  
                                               , '-un quaddecillion' , '-un quaddecillions')  
                                               , '-un quindecillion' , '-un quindecillions')  
                                               , '-un sexdecillion'  , '-un sexdecillions' )  
                                               , '-un septdecillion' , '-un septdecillions')  
                                               , '-un octdecillion'  , '-un octdecillions' )  
                                               , '-un nondecillion'  , '-un nondecillions' )  
                                               , '-un dedecillion'   , '-un dedecillions'  )  
                                                  , '-un million'       , '-un millions'    ) 
                                                  , '-un bidecillion'   , '-un bidecillions') 
                                                  , '-un cintillion'    , '-un cintillions' ) 
                                                  , '-un milliard'      , '-un milliards'   ) 
                                                  , 'point'             , 'virgule'         ) 
    					     ,'  ',' '); 
     
        IF SUBSTR(lv$nombre_fr,1,8)='un mille' THEN
    	  lv$nombre_fr := SUBSTR(lv$nombre_fr,4);
    	END IF;
     
        RETURN lv$nombre_fr;
    END translate_fr; 
    /
    merci beucoup
    mais j'ai un autre petit probleme
    quand j'ai un montant de 7 480,300 et qui est stocké dans la base 7480,3
    en principe il m'affiche
    sept milleS quatre centS quatre-vingts DINARS trois centS MILLIMES
    mais il m'affiche
    sept mille quatre cent quatre-vingts DINARS trois MILLIMES

    aussi tu remarques que le 'S' du CENTS n'est pas affiché

  15. #15
    Expert éminent sénior
    Avatar de orafrance
    Profil pro
    Inscrit en
    Janvier 2004
    Messages
    15 967
    Détails du profil
    Informations personnelles :
    Âge : 47
    Localisation : France

    Informations forums :
    Inscription : Janvier 2004
    Messages : 15 967
    Points : 19 075
    Points
    19 075
    Par défaut
    c'est normal, vérifie les règles d'orthographe

    Mille est invariable et cent ne se conjugue que si il n'est pas suivi de dizaine ou unité (deux cents mais deux cent dix )

  16. #16
    Membre régulier
    Inscrit en
    Octobre 2005
    Messages
    279
    Détails du profil
    Informations forums :
    Inscription : Octobre 2005
    Messages : 279
    Points : 80
    Points
    80
    Par défaut
    Citation Envoyé par orafrance Voir le message
    c'est normal, vérifie les règles d'orthographe

    Mille est invariable et cent ne se conjugue que si il n'est pas suivi de dizaine ou unité (deux cents mais deux cent dix )
    ok, je dois reviser mon orthographe.
    mais j'ai un autre petit probleme
    quand j'ai un montant de 7 480,300 et qui est stocké dans la base 7480,3
    en principe il m'affiche
    sept mille quatre cent quatre-vingts DINARS trois cents MILLIMES
    mais il m'affiche
    sept mille quatre cent quatre-vingts DINARS trois MILLIMES

  17. #17
    Expert éminent sénior
    Avatar de orafrance
    Profil pro
    Inscrit en
    Janvier 2004
    Messages
    15 967
    Détails du profil
    Informations personnelles :
    Âge : 47
    Localisation : France

    Informations forums :
    Inscription : Janvier 2004
    Messages : 15 967
    Points : 19 075
    Points
    19 075
    Par défaut
    c'est normal, si tu ne veux pas avoir ce problème c'est à toi d'ajouter les 0.

  18. #18
    Membre régulier
    Inscrit en
    Octobre 2005
    Messages
    279
    Détails du profil
    Informations forums :
    Inscription : Octobre 2005
    Messages : 279
    Points : 80
    Points
    80
    Par défaut
    Citation Envoyé par orafrance Voir le message
    c'est normal, si tu ne veux pas avoir ce problème c'est à toi d'ajouter les 0.
    moi j'ai un champ de type FLOAT(15,3) dans la base, oracle 10.2
    et dans forms la masque de format est :FM999G999G999G990D000
    en forms : montant = 7 950 000,700
    dans la base : montant = 7950000,7

    est ce que tu peux m'aider comment faire
    et merci pour ton effort

  19. #19
    Expert éminent sénior
    Avatar de orafrance
    Profil pro
    Inscrit en
    Janvier 2004
    Messages
    15 967
    Détails du profil
    Informations personnelles :
    Âge : 47
    Localisation : France

    Informations forums :
    Inscription : Janvier 2004
    Messages : 15 967
    Points : 19 075
    Points
    19 075
    Par défaut
    pourquoi ne pas stocker en VARCHAR2 dans la base le contenu de l'item tout bêtement ?

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    SUBSTR(ta_colonne || '000', 1, INSTR(ta_colonne,',')+3)
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    SQL> SELECT NB_EN_LETTRE(SUBSTR('&a' || '000', 1, INSTR('&a',',')+3)) FROM dual
      2  ;
    Enter value for a: 7950000,7
    Enter value for a: 7950000,7
    old   1: SELECT NB_EN_LETTRE(SUBSTR('&a' || '000', 1, INSTR('&a',',')+3)) FROM dual
    new   1: SELECT NB_EN_LETTRE(SUBSTR('7950000,7' || '000', 1, INSTR('7950000,7',',')+3)) FROM dual
     
    NB_EN_LETTRE(SUBSTR('7950000,7'||'000',1,INSTR('7950000,7',',')+3))
    --------------------------------------------------------------------------------
    sept millions neuf cent cinquante mille virgule sept cents

  20. #20
    Membre régulier
    Inscrit en
    Octobre 2005
    Messages
    279
    Détails du profil
    Informations forums :
    Inscription : Octobre 2005
    Messages : 279
    Points : 80
    Points
    80
    Par défaut
    Citation Envoyé par orafrance Voir le message
    pourquoi ne pas stocker en VARCHAR2 dans la base le contenu de l'item tout bêtement ?

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    SUBSTR(ta_colonne || '000', 1, INSTR(ta_colonne,',')+3)
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    SQL> SELECT NB_EN_LETTRE(SUBSTR('&a' || '000', 1, INSTR('&a',',')+3)) FROM dual
      2  ;
    Enter value for a: 7950000,7
    Enter value for a: 7950000,7
    old   1: SELECT NB_EN_LETTRE(SUBSTR('&a' || '000', 1, INSTR('&a',',')+3)) FROM dual
    new   1: SELECT NB_EN_LETTRE(SUBSTR('7950000,7' || '000', 1, INSTR('7950000,7',',')+3)) FROM dual
     
    NB_EN_LETTRE(SUBSTR('7950000,7'||'000',1,INSTR('7950000,7',',')+3))
    --------------------------------------------------------------------------------
    sept millions neuf cent cinquante mille virgule sept cents
    MERCI MAIS j'aurai des problemes si je veux faire des statiqtiques sur ce montant
    en plus la table contient les factures et le champ est le montant TTC
    moi, j'ai pensé à une solution dans l

+ Répondre à la discussion
Cette discussion est résolue.
Page 1 sur 2 12 DernièreDernière

Discussions similaires

  1. [AC-2003] Montant en toutes lettres
    Par akrimi08 dans le forum IHM
    Réponses: 9
    Dernier message: 27/04/2010, 17h30
  2. [VB.NET]Convertir un montant numérique en lettres
    Par kinganasius dans le forum Windows Forms
    Réponses: 5
    Dernier message: 27/07/2009, 20h13
  3. Réponses: 1
    Dernier message: 04/06/2007, 07h51
  4. [Mail] Convertir une somme en toute lettres
    Par mijean dans le forum Langage
    Réponses: 2
    Dernier message: 29/05/2007, 11h37
  5. Réponses: 1
    Dernier message: 21/03/2007, 10h07

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo