Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Ho do I convert decimal to hex with a twist?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00123780
Message ID:
00123809
Vues:
13
>>Just ? transform( INT( x ), "@0" )
>
>Hi David,
>
>That still gives me a result of 0x0000000A. We're looking for a way to convert a numeric value with decimal places to a value we can store in a non-numeric field. Thing is though the decimal places mean something in our scenario. And I take it hex is the wrong way to go since it only uses integers. Any other thoughts?

Rox,

You're right about it only using integers. Hexadecimal values were used primarily for indicating the value stored in bytes, which, of course, are integers. How 'bout taking two fixed length values? Use BINTOC() to covert the integer portion, then raise the fractional portion by an appropriate power of 10 to covert that to an integer. Then use BINTOC() again and concatenate the results.

hth,
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform