473,327 Members | 2,055 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

isNumeric function?

Hello,

Is there a (relatively) simple way to tell if a column
is a "numeric" type other than comparing against the
seven or so oids which may or may not be the complete
list of things genererally considered to be numeric?

I need this info to determine whether or not to justify
left or right in a data display.

Thanks

Jerry
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 23 '05 #1
1 6042
On Mon, 2004-07-26 at 09:52, Jerry LeVan wrote:
Is there a (relatively) simple way to tell if a column
is a "numeric" type other than comparing against the
seven or so oids which may or may not be the complete
list of things genererally considered to be numeric?

I need this info to determine whether or not to justify
left or right in a data display.


No, in fact it's more complicated than your example. You'd also want to
consider which type a domain maps down to. There really isn't anything
you can do to know if an extended type is a simple numeric (without
running a regex on all the output data -- which is beyond icky). For
formatting you'd probably not want to consider composite types or arrays
as numeric even if they're totally composed of a builtin numeric base
type.

So, in addition to keeping a list of "pg_type.typname"s you consider
numeric, you'd also want UNION "pg_type.typbasetype" WHERE
"pg_type.typtype" = 'd' among some other restrictions.

See http://www.postgresql.org/docs/7.4/s...g-pg-type.html for
more info.

As you said this was in an application, your DB driver may automatically
map output types to SQL defined ones. If this is the case you might
consider just relying on your driver's mapping.

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Joe | last post by:
Hello All: Does anyone know how someone would check for a numeric value in .NET? In VB6, we used IsNumeric. What's the .NET equivalent? BTW, I know that I can harken back to IsNumeric. I'm...
7
by: Nathan Truhan | last post by:
All, I think I may have uncovered a bug in the IsNumeric function, or at least a misunderstanding on functionality. I am writing a Schedule Of Classes Application for our campus and have a...
12
by: sck10 | last post by:
Hello, I am trying to determine if a value is NOT numeric in C#. How do you test for "Not IsNumeric"? protected void fvFunding_ItemInserting_Validate(object sender, FormViewInsertEventArgs...
2
by: James | last post by:
Simple question... If you execute a block of statements that uses the IsNumeric function on a text box that contains no data, will it cause a run time error? Thanks looks like this: If...
8
by: munkeyb0i | last post by:
Hi, The program that I have to make is suppose to check if the things I entered in the textbox is numeric and also if it's 9 digits. I tried a lot of ways to do it but none of them seem to work. ...
3
by: eihabisaac | last post by:
i found this code in a website and it works but the problem is when i press TAB and BACKSPACE it also give me the error message <script type='text/javascript'> function isNumeric(elem,...
0
LoanB
by: LoanB | last post by:
Hi There I have the following code which checks if a input data is Numeric. private bool IsNumeric(string subject) { return (System.Text.RegularExpressions.Regex.IsMatch(subject, "^*..*$"));...
9
by: bizt | last post by:
Hi, I am using the following function to validate a forms value as an integer function isNumeric(str){ var numericExpression = /^+$/; if(str.match(numericExpression)){ return true; }else{
3
by: clflyer | last post by:
Visual Basic has a function IsNumeric. It returns True if the argument is a number, false if not. in VB code it would look like this: Dim txt as string = me.Textbox1.Text if IsNumeric(txt)...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.