Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Ho do I convert decimal to hex with a twist?
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00123780
Message ID:
00123809
Views:
12
>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform