niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Databases » Sybase
Round-off of a float column
Post new topic   Reply to topic Page 1 of 1 [4 Posts] View previous topic :: View next topic
Author Message
Rob Verschoor
*nix forums addict


Joined: 19 May 2005
Posts: 75

PostPosted: Mon Jul 17, 2006 10:24 am    Post subject: Re: Round-off of a float column Reply with quote

It's not stored in the catalogs. The square brackets are not part of the
identifier, but merely delimiters -- you can always put these around the
name of an existing table and it'll work normally. One side effect is that
reserved words are not recognised as such anymore so you can use 'm as
identifiers.

HTH,

Rob V.
-------------------------------------------------------------
Rob Verschoor

Certified Sybase Professional DBA for ASE 12.5/12.0/11.5/11.0
and Replication Server 12.5 / TeamSybase

Author of Sybase books (order online at www.sypron.nl/shop):
"Tips, Tricks & Recipes for Sybase ASE"
"The Complete Sybase Replication Server Quick Reference Guide"
"The Complete Sybase ASE Quick Reference Guide"

mailto:rob@YOUR.SPAM.sypron.nl.NOT.FOR.ME
http://www.sypron.nl
Sypron B.V., P.O.Box 10695, 2501HR Den Haag, The Netherlands
-------------------------------------------------------------

"Rob Verschoor" <rob@DO.NOT.SPAM.sypron.nl.REMOVE.THIS.DECOY> wrote in
message news:ac4a6$44bb6469$d55d70a1$23136@news.chello.nl...
Quote:
Use the round() function: this lets you specify how many significant
digits
to round to.

HTH,

Rob V.
-------------------------------------------------------------
Rob Verschoor

Certified Sybase Professional DBA for ASE 12.5/12.0/11.5/11.0
and Replication Server 12.5 / TeamSybase

Author of Sybase books (order online at www.sypron.nl/shop):
"Tips, Tricks & Recipes for Sybase ASE"
"The Complete Sybase Replication Server Quick Reference Guide"
"The Complete Sybase ASE Quick Reference Guide"

mailto:rob@YOUR.SPAM.sypron.nl.NOT.FOR.ME
http://www.sypron.nl
Sypron B.V., P.O.Box 10695, 2501HR Den Haag, The Netherlands
-------------------------------------------------------------

"mullin" <mullin.yu@gmail.com> wrote in message
news:1152864919.446918.210360@h48g2000cwc.googlegroups.com...
If i want to round off column amount with datatype float of a table,
table1, how can i round it off?

e.g.
amount: 67032 => 67032
amount: 67032.1234 => 67032.1234
amount: 67032.123422 => 67032.123422
amount: 67032.1234228 => 67032.123423
amount: 67032.1234224 => 67032.123422
amount: 67032.123422812 => 67032.123423
amount: 67032.123422489 => 67032.123422


Back to top
Rob Verschoor
*nix forums addict


Joined: 19 May 2005
Posts: 75

PostPosted: Mon Jul 17, 2006 10:19 am    Post subject: Re: Round-off of a float column Reply with quote

Use the round() function: this lets you specify how many significant digits
to round to.

HTH,

Rob V.
-------------------------------------------------------------
Rob Verschoor

Certified Sybase Professional DBA for ASE 12.5/12.0/11.5/11.0
and Replication Server 12.5 / TeamSybase

Author of Sybase books (order online at www.sypron.nl/shop):
"Tips, Tricks & Recipes for Sybase ASE"
"The Complete Sybase Replication Server Quick Reference Guide"
"The Complete Sybase ASE Quick Reference Guide"

mailto:rob@YOUR.SPAM.sypron.nl.NOT.FOR.ME
http://www.sypron.nl
Sypron B.V., P.O.Box 10695, 2501HR Den Haag, The Netherlands
-------------------------------------------------------------

"mullin" <mullin.yu@gmail.com> wrote in message
news:1152864919.446918.210360@h48g2000cwc.googlegroups.com...
Quote:
If i want to round off column amount with datatype float of a table,
table1, how can i round it off?

e.g.
amount: 67032 => 67032
amount: 67032.1234 => 67032.1234
amount: 67032.123422 => 67032.123422
amount: 67032.1234228 => 67032.123423
amount: 67032.1234224 => 67032.123422
amount: 67032.123422812 => 67032.123423
amount: 67032.123422489 => 67032.123422
Back to top
bret@sybase.com
*nix forums addict


Joined: 24 May 2005
Posts: 66

PostPosted: Fri Jul 14, 2006 12:10 pm    Post subject: Re: Round-off of a float column Reply with quote

mullin wrote:
Quote:
If i want to round off column amount with datatype float of a table,
table1, how can i round it off?

e.g.
amount: 67032 => 67032
amount: 67032.1234 => 67032.1234
amount: 67032.123422 => 67032.123422
amount: 67032.1234228 => 67032.123423
amount: 67032.1234224 => 67032.123422
amount: 67032.123422812 => 67032.123423
amount: 67032.123422489 => 67032.123422


For purposes of calculation, use the round() function, which will
generate
the FLOAT value that is closes to the desired rounded value (however,
since FLOAT is bases on powers of 2, there may be a small amount of
error).

For purposes of display, use the str() function to convert the value to
an ASCII string.

-bret
Back to top
mullin
*nix forums beginner


Joined: 08 Sep 2005
Posts: 2

PostPosted: Fri Jul 14, 2006 8:15 am    Post subject: Round-off of a float column Reply with quote

If i want to round off column amount with datatype float of a table,
table1, how can i round it off?

e.g.
amount: 67032 => 67032
amount: 67032.1234 => 67032.1234
amount: 67032.123422 => 67032.123422
amount: 67032.1234228 => 67032.123423
amount: 67032.1234224 => 67032.123422
amount: 67032.123422812 => 67032.123423
amount: 67032.123422489 => 67032.123422
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [4 Posts] View previous topic :: View next topic
The time now is Fri Nov 21, 2008 12:06 pm | All times are GMT
navigation Forum index » Databases » Sybase
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Column info without executing query Dan Strömberg PostgreSQL 10 Thu Jul 20, 2006 6:21 pm
No new posts How to query on part of a date column? Barry Newton MySQL 4 Thu Jul 20, 2006 5:02 pm
No new posts Column XXXX not in specified tables. (#-206) <--- Please ... Gb IBM DB2 4 Sun Jul 16, 2006 4:20 am
No new posts Problem converting a string to a float value dean.elwood@gmail.com C 3 Sun Jul 09, 2006 6:39 pm
No new posts array of array of float Summercoolness@gmail.com python 6 Sun Jul 09, 2006 5:50 pm

Loans | Loans | Remortgages | Loans | Adverse Credit Remortgage
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1835s ][ Queries: 20 (0.0842s) ][ GZIP on - Debug on ]