Information générale
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
You don't need the cSng(), and it also depends if your application is
dependent on rounding. In the case below, you would return 1.0, but in
the case of 1.999, you may want to return 2.0; so you would use
cInt(Round("1.999",0))
If you don't care about rounding, just skip the cSng and use cInt() to
chop off the floating portion.
>Ed,
>
>Thanks for the response. I was using the CSng() function in the code, but I wanted to have someone who knew what they were doing to confirm it.
>
>One more stupid question. Can I use the following combination of functions to convert the string containing the floating point number to an integer? If not, what should I use?
>
>CInt(CSng("111.111"))
>
>Thanks,
>
>Ben Holton
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement