CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

UDF: How to convert a float to a string?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 10, 2006, 09:37
Default UDF: How to convert a float to a string?
  #1
Nico Hoffmann
Guest
 
Posts: n/a
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
  Reply With Quote

Old   April 10, 2006, 12:00
Default Re: UDF: How to convert a float to a string?
  #2
Nico Hoffmann
Guest
 
Posts: n/a
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.
  Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to convert string type to scalar type zhajingjing OpenFOAM Programming & Development 7 August 2, 2023 08:46
Convert VOF droplet to DPM particle via UDF TedBrogan Fluent UDF and Scheme Programming 1 May 1, 2012 12:01
How to convert my UDF to parallel? lapin_tout_fou Fluent UDF and Scheme Programming 2 September 22, 2011 04:51
Missing math.h header Travis FLUENT 4 January 15, 2009 12:48
to correct me an udf program farida hamadi FLUENT 0 December 18, 2004 06:54


All times are GMT -4. The time now is 14:42.