Jump to content
Jörg

String Formatting (Precision, Field Width, Fill Character)

Recommended Posts

There are a couple of formatting controls in CAESES if you put a floating point number into a string. Here is a simple example for the toString() command that uses the global formatting and a given precision:

number.toString("g",precision)

The command asString() gives you a bit more control. If you like to change the field width, precision or the fill character, then you can use this one:

string myString( asString(number,field_width,precision,fill_char) )

With this, it is easy to write (export) files with a custom format or create custom labels for the 3D view.

 

I have attached a project where you can try it out. There is also some console output that shows the results.

 

Cheers

Joerg

post-8-0-58810900-1513693453_thumb.png

string_formatting.fdb

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...