OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

[solve] help oobase, number become zero after dot in DECIMAL

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base
View previous topic :: View next topic  
Author Message
john1123
General User
General User


Joined: 28 Jun 2012
Posts: 8

PostPosted: Thu Jun 28, 2012 12:52 am    Post subject: [solve] help oobase, number become zero after dot in DECIMAL Reply with quote

i have set the field type to decimal[DECIMAL]
but when i key in the data it still showing zero
example: 10.5 --> 10
can help me to solve this problem????


Last edited by john1123 on Sun Jul 01, 2012 9:38 pm; edited 1 time in total
Back to top
View user's profile Send private message
Sliderule
Super User
Super User


Joined: 29 May 2004
Posts: 2499
Location: 3rd Rock From The Sun

PostPosted: Thu Jun 28, 2012 6:44 am    Post subject: Reply with quote

If you are defining the field type to DECIMAL, you can also set a value ( number ) for the maximum number of decimal places you want defined for the field, you must also define that.

If you want the stored data in the table to have an accurracy up to 15 decimal places, whether. for example. 0 or 5 or 8 or 11 or 13. define the field type as Number [ Numeric ] rather than a Decimal. Smile

I hope this helps, please be sure to let me know.

Sliderule

Thanks to add [Solved] in your first post Title ( edit button ) if your issue has been fixed / resolved.
Back to top
View user's profile Send private message
john1123
General User
General User


Joined: 28 Jun 2012
Posts: 8

PostPosted: Thu Jun 28, 2012 5:06 pm    Post subject: Reply with quote

i have try to use number [NUMERIC] also
but i still get the same problem that after i type 10.5 and done the data key in it will goes to zero after the dot (10)

ps: i using open office 3.4, win xp
Back to top
View user's profile Send private message
Sliderule
Super User
Super User


Joined: 29 May 2004
Posts: 2499
Location: 3rd Rock From The Sun

PostPosted: Thu Jun 28, 2012 5:16 pm    Post subject: Reply with quote

john1123 wrote:
Posted: Thu Jun 28, 2012 6:06 pm Post subject:
i have try to use number [NUMERIC] also
but i still get the same problem that after i type 10.5 and done the data key in it will goes to zero after the dot (10)

Where are you entering your data?
  1. Table -> Open
  2. At the bottom of a Query
  3. A form you built
  4. Other

john1123 wrote:
and done the data key

I have no idea what you are talking about.

Sliderule
Back to top
View user's profile Send private message
john1123
General User
General User


Joined: 28 Jun 2012
Posts: 8

PostPosted: Fri Jun 29, 2012 1:06 am    Post subject: Reply with quote

at tables, queries and forms also try

i really have not ideal wht to do
Back to top
View user's profile Send private message
Sliderule
Super User
Super User


Joined: 29 May 2004
Posts: 2499
Location: 3rd Rock From The Sun

PostPosted: Fri Jun 29, 2012 5:54 am    Post subject: Reply with quote

john1123 wrote:
i really have not ideal wht to do

Nor do I. I have never seen what you are describing.

Sliderule
Back to top
View user's profile Send private message
john1123
General User
General User


Joined: 28 Jun 2012
Posts: 8

PostPosted: Fri Jun 29, 2012 7:29 pm    Post subject: Reply with quote

sorry my English is not good Razz Razz
Smile Smile

ok, now my problem is my data need to key in as number and it only have 2 digit of decimal,
but every time i key in the data, it only show the number, and the decimal will become zero
like this example: 10.50, it will go to 10 only
even though i use number[NUMERIC], it will become 10.00
i cant get the 0.50 amount

i have try to set the language as English USA at tools->option->language

and i have also try this SQL that i read at this forum
code:
-- Add the NEW field before the old field to the table as a decimal with 2 decimal places default to zero
ALTER TABLE "FactDiaria" ADD COLUMN "CajaEmpUSD_02" DECIMAL(15,2) DEFAULT 0.00 NOT NULL BEFORE "CajaEmpUSD"

-- Populate the New field with the data from the old, and, 0 if NULL in the old
UPDATE "FactDiaria" SET "CajaEmpUSD_02 = COALESCE("CajaEmpUSD",0)

-- Remove the OLD field
ALTER TABLE "FactDiaria" DROP COLUMN "CajaUSD"

-- Change the name of the NEW field to the name of the OLD field ( just removed )
ALTER TABLE "FactDiaria" ALTER COLUMN "CajaUSD_02" RENAME TO "CajaUSD"


but at the end i still cant get my decimal digit
Razz Razz
Back to top
View user's profile Send private message
Sliderule
Super User
Super User


Joined: 29 May 2004
Posts: 2499
Location: 3rd Rock From The Sun

PostPosted: Fri Jun 29, 2012 7:51 pm    Post subject: Reply with quote

Follow these steps:

  1. Open your OpenOffice Base File ( *.odb )
  2. Click on the Tables icon on the left
  3. Right click on table: "FactDiaria" Open
  4. At the top of column "CajaUSD" right click and choose: Column Format...
  5. On the Format Tab, at Options, Decimal Place, select 2
  6. Click on the red X in top right corner
  7. To save the formatting for this field: Either:
    1. Click on the Save icon on the toolbar
    2. Ctrl + S
    3. From the Menu: File -> Save
I hope this helps, please be sure to let me / us know.

Sliderule

Thanks to add [Solved] in your first post Title ( edit button ) if your issue has been fixed / resolved.
Back to top
View user's profile Send private message
john1123
General User
General User


Joined: 28 Jun 2012
Posts: 8

PostPosted: Fri Jun 29, 2012 10:54 pm    Post subject: Reply with quote

T T
now is show 10.00
but my 0.50 still missing

is that my computer problem??
but i have try at my company's computer, it have a same problem

i'm using win xp sp2, open office v3.4
computer language : English- US
open office language: English-US
Back to top
View user's profile Send private message
Sliderule
Super User
Super User


Joined: 29 May 2004
Posts: 2499
Location: 3rd Rock From The Sun

PostPosted: Sat Jun 30, 2012 6:37 am    Post subject: Reply with quote

I am sending you a PM ( Private Message ).

Sliderule
Back to top
View user's profile Send private message
john1123
General User
General User


Joined: 28 Jun 2012
Posts: 8

PostPosted: Tue Jul 03, 2012 7:38 pm    Post subject: thanks sliderule Reply with quote

[img]http://gq1.attach.mail.ymail.com/us.f1147.mail.yahoo.com/ya/securedownload?mid=2%5f0%5f0%5f4%5f27110%5fAIy3iGIAACi4T%2fEzPQnyR1GsgDc&pid=2.2&fid=Trash&inline=1&appid=YahooMailNeo&cred=tJZ8pWTbD5LoOojN_ZJBAh56SCgwf1jPrWv1o2petDlkFOQ6Cl7Ak.jqFIHJ_T.wJ3Ig5e0p9jsloJVRC9SKXwnOholU6OQCN.tjw6Bo77YNxCz3usOX_9ZY7LzfLI.a4Moj3a31IoFVmyn_0Ugy&ts=1341372653&partner=ymail&sig=eQqOwB5KcON.J2r.Ti7mEw--[/img]
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group