CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   UDF: How to convert a float to a string? (http://www.cfd-online.com/Forums/fluent/40511-udf-how-convert-float-string.html)

Nico Hoffmann April 10, 2006 08:37

UDF: How to convert a float to a string?
 
Hello,

I need the string representation of the flow time in my UDF.

The CURRENT_TIME macro outputs this time, but as a floating point number.

I tried to convert this float with sprintf into char[], but fluent says 'undeclared variable'. The arguments to sprintf are declared and o.k., of course.

any hints?

Nico

Nico Hoffmann April 10, 2006 11:00

Re: UDF: How to convert a float to a string?
 
Hi again.

maybe I found a solution. If I compile my udf instead of interpreting it, i can use all this nice standard-C functions. O.K., at least I can use sprintf now.


All times are GMT -4. The time now is 15:52.