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

UDF: How to convert a float to a string?

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   April 10, 2006, 08: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, 11: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

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 18:01.