Currently it's not possible to convert a String or Real to Single Real using IronPython to set the value to a document property of type SingleReal. It's doable using Spotfire data function. But we would like to have it also on IronPython.
Reference :
When assigning values to document properties from IronPython scripts, Spotfire automatically tries to convert a string to the target type, e.g. SingleReal. So, the following should work in your case:
value = 1.234 # float value in Python
Document.Properties["mysinglerealproperty"] = str(value)
Hi Magnus
Yes, it worked.
Thanks for help very much! .. This request can be closed.
Hi Anas, thanks for the clarification.
Spotfire automatically tries to convert a string to the target type, e.g. SingleReal. So, the following should work in your case:
value = 1.234 # float value in Python
Document.Properties["mysinglerealproperty"] = str(value)
Hi Anas, Thanks for contribution. Not sure I understand the context, but wouldnät it be possible to use general conversion functions in Python, e.g. float(value)?