You can try this modification:
FUNCTION FN_NEW_TEST (Lat Number) RETURN NUMBER AS
my_var NUMBER(5,3);
BEGIN
my_var:=Lat;
RETURN my_var;
END;
Main Topics
Browse All Topics
How do I specify the number format for the returned variable.
the following code will compile if I remove the (5,3).
The view works fine in oracle but Access doesn't want to display the decimal values in a combo box and instead displays a bunch of chinese type characters when I use the results as a recordsource.
I've tried converting the results to character format but then I can't sort the results....aargh!
create or replace
FUNCTION FN_NEW_TEST
(Lat Number)
RETURN NUMBER(5,3) AS
BEGIN
RETURN Lat;
END;
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
All valid responses to my question, I've tried Henka's method but it still comes back in chinese type characters when I use the results as a recordsource in access.
This is probably more of an access issue but I wanted to explorer the possibility of passing a pre-defined number format. I'm now going to shoot myself as its driving me nuts.
You can create a function that will return a character value in the desired format. However, I suspect Access will do an implicit conversion and display it in its default format. It may be worth a try.
SQL> create or replace function sho_fmt(no_in in number) return varchar2 is
2 v_no varchar2(12);
3 begin
4 v_no := to_char(no_in,'999.999');
5 return v_no;
6 end;
7 /
Function created.
SQL> select sho_fmt(10.67) from dual;
SHO_FMT(10.67)
--------------------------
10.670
Business Accounts
Answer for Membership
by: HenkaPosted on 2007-01-19 at 00:25:12ID: 18347650
"number format for the returned variable" - it cannot be done. -> this is from documentation:
RETURN Clause
For datatype, specify the datatype of the return value of the function. Because every function must return a value, this clause is required. The return value can have any datatype supported by PL/SQL.
Note:
Oracle SQL does not support calling of functions with Boolean parameters or returns. Therefore, if your user-defined functions will be called from SQL statements, you must design them to return numbers (0 or 1) or character strings ('TRUE' or 'FALSE').
The datatype cannot specify a length, precision, or scale. Oracle Database derives the length, precision, or scale of the return value from the environment from which the function is called.