Jump to content

Format String into Variant suggestions


Recommended Posts

I'm currently writing an XML library based on OpenG Data and String functions. I use the functions Format Variant into String and Scan Variant from String to do String<->Variant conversions. It works but I stumbled upon problems that required me to modify these VIs:

- Scan Variant from String can change the data type of the original Variant. If I format any integer type the output Variant alway contains an I64, any floating point type becomes an EXT, any complex type becomes a CXT. This was not acceptable for me so I fixed it

- Both VIs have problems with locale decimal points if no format string is specified. I added a control Default Floating Point Format to specify a default format string for floating point numbers.

StringToVariant.zip

I'd like to contribute my modifications, IMHO they could be useful for others, too. :)

Link to comment

Both VIs have problems with locale decimal points if no format string is specified. I added a control Default Floating Point Format to specify a default format string for floating point numbers.

I don't use either library often, what caught my eye was the locale decimal point part. The addition of a specifier for the separator and the implications are being discussed in the other thread.

Link to comment
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.