Member Login

Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

format decimal number

format decimal number

Dear sir
How can i format decimal number to be displayed in datawindow with replacing decimal dot separatore with space as:
145.65    displayed as   145 650
67.652                   675 652
0.53                         530  (no decimal number}
I did this using computed field , but i think there is another way.

many thanks

RE: format decimal number

Try 'playing' with the format of the column in the datawindow painter.  I've done things like appended letter status to dates, appended asterisks to numbers, and such.  Maybe something like:

left(string(number),pos(string(number),'.' - 1)) + ' ' + right(string(number),len(string(number)) - pos(string(number),'.'))

since the resulting column is a string and not a number there may be other formatting issues.

RE: format decimal number

thanks mplanet
I wrote that script in format propert of the field, but find some valid /invalid values e.g.
23.45 --> 23 45
0.14   --> 14  
0.76   --> 1 76

when number >= 0.5 , it is 1 + decimal
also i want to align numbers in that away
145.65    145 650
675.65     675 650
0.53          530  
i think as you said "since the resulting column is a string and not a number there may be other formatting issues"

can we find these issues.
many thanks

RE: format decimal number

left(string(number * 1000
),pos(string(number * 1000
),'.' - 1)) + ' ' + right(string(number * 1000
),len(string(number * 1000
)) - pos(string(number * 1000

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close