Problem to display big numbers in javascript
I try to display a big number but the result is not correct.
My code:
var n = 1771653332244424314244444;
console.println(util.printf("Float format: %f", n));
Result:
Float format: 1771653332244424300000000.
The result is round. Why ?
How to do to display the good number ?
David
> The result is round. Why ?
This is the normal limitation of the representation of floating numbers.
> How to do to display the good number ?
You can use a JavaScript library like BigInt.js:
http://www.leemon.com/crypto/BigInt.html
Similar Messages
-
Problem with displaying long numbers in flex.
I'm trying to display a usps tracking number in a textbox. However it automatically converts to an exponential value. Any way to bypass this?
I'm getting the value from the xml file.
this 9121805213907020609207 show up as 9.12180521390702e+21Hi,
When you are Trying to display that no in TextBox directyly pass that number to TextBox as String itself , If you are not using that value any where in Flex side this is the best Idea But if you want to use that number it will be a problem why because a long value can take a max value of 2^63-1 but your value is more than that. -
Problem with displaying BLOB images on JSP page using a servlet
hi. I have a big problem with displaying BLOB images using JSP. I have a servlet that connects to the oracle database, gets a BLOB image , reads it, and then displays it using a BinaryStream. The problem is , this works only when i directly call that servlet, that is http://localhost:8080/ImageServlet. It doesn't work when i try to use that servlet to display my image on my JSP page (my JSP page displays only a broken-image icon ) I tried several coding approaches with my servlet (used both Blob and BLOB objects), and they work just fine as long as i display images explicitly using only the servlet.
Here's what i use : ORACLE 10g XE , Eclipse 3.1.2, Tomcat 5.5.16 , JDK 1.5
here is one of my image servlet's working versions (the essential part of it) :
BLOB blob=null;
rset=st.executeQuery("SELECT * FROM IMAGES WHERE ID=1");
while (rset.next())
blob=((OracleResultSet)rset).getBLOB(2);
response.reset();
response.setContentType("image/jpeg");
response.addHeader("Content-Disposition","filename=42.jpeg");
ServletOutputStream ostr=response.getOutputStream();
InputStream istr=blob.getBinaryStream(1L);
int size=blob.getBufferSize();
int len=-1;
byte[] buff = new byte[size];
while ((len=istr.read( buff ))!=-1 ) {
ostr.write(buff,0,len);
response.flushBuffer();
ostr.close(); and my JSP page code :
<img src="/ImageServlet" border="0" > If you could just tell me what i'm doing wrong here , or if you could show me your own solutions to that problem , i would be very greatful ,cos i'm realy stuck here , and i'm rather pressed for time too. Hope someone can help.I turns out that it wasn't that big of a problem after all. All i had to do was to take the above code and place it into another JSP page instead of into a servlet like i did before. Then i just used that page as a source for my IMG tag in my first JSP. It works perfectly well. Why this doesn't work for servlets i still don't know, but it's not a problem form me anymore . Ofcourse if someone knows the answer , go ahead and write. I would still appriceatte it.
here's the magic tag : <img src="ImageJSP.jsp" border="0" > enjoy : ) -
Problem in displaying Flash works (only in IE)
Hi,
we have problem in displaying the flash animations, as it
shows a box like surrounding, after when we double click it, it
gets activated. We face this problem only in IE and not in any
other browsers. We want to know the technical reason for this
problem and is that anything because of virus, or browser version
conflicts....etc., please let us know the reason and solution as
soon as possible.There are hundreds of new and magazine and online articles on
this over the
last couple of months .. and similar numbers of forum posts
here. Its a
very hot topic.
A quick search in Google or on these forums would have turned
up a wealth of
information. Maybe you should try that? Try looking for the
phrase "Click
to activate and use this control" - close to 25000 web pages
talking about
it.
If you can't be bothered to do so .. try looking at this site
http://activecontent.blogspot.com/
... look at the links articles at the
bottom of the page .. like this one
http://msdn.microsoft.com/ieupdate/
Jeckyl -
Problems to delete big *.tif files
I have problems to delete big *.tif filese.
At first Windows delete it, but if i pressed F5 then the files are not deleted. I have tryed to delete it with and without Shift + Del its always the same.
When i delete this file many times then it would be deleted.
A other Problem with this big files is that windows open a dialogbox and calculate the time that needed to delete the tif file.
But i can wait 2 hours and more, nothing is done by windows. In the dialogbox dosn`t change anything.
Have anyone an Idea?
Thank you in advanced.
DanielHi,
Does it happen to other files, just *.tif files? Generally speaking, When deleting a folder, the calculation time depends on not only the
file size but the file numbers of the folder. So you can delete sub-folders separately.
Also, you can try to use a popular methods to fix the issue. Here is the steps:
1. Right click on the file.
2. Click Properties
3. Click
Advanced
4. Under File Attributes uncheck
Allow this file to have contents indexed in addition to file.
Also, you can take the following steps to fix this issue:
Step 1:
You may try creating a new user profile to see if the same problem occurs. If not then it could be a corruption/permissions problem
of the old user profile.
To create a new user account
http://windows.microsoft.com/en-us/Windows7/Create-a-user-account
Step 2:
If the new user account works fine then the previous account was corrupt, you may follow the link given below to fix the corrupt
user profile.
Fix a corrupted user profile
http://windows.microsoft.com/en-US/Windows7/Fix-a-corrupted-user-profile
In addition, the issue can be related to third-party components, especially file system filter drivers, such as anti-virus drivers. In this situation,
I suggest you can delete the files on Safe Mode. If on Safe Mode It works fine, you could perform
clean boot to check the result.
Hope it helps.
Regards,
Alex Zhao
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. -
[JPA] Saving big numbers to the database
Hi,
I have a JPA problem that I cannot solve. I try to save a large number to the database and JPA performs some strange rounding. For example, saving the number 9999999999999999.00 produces the following number in the database: 10000000000000000.00.
Actually, I'm not sure if it's JPA or the Oracle JDBC driver, but somebody rounds the number. That's bad!
Here's how to reproduce the issue:
1. Database:
create table big_num
(id number(18),
num number(19,2));
alter table big_num
add constraint big_num_pk primary key (id);
create sequence big_num_seq
start with 1
nocache;2. Entity:
@Entity
@Table(name="BIG_NUM")
@SequenceGenerator(name="bigNumSeq", sequenceName="BIG_NUM_SEQ", allocationSize=1)
public class BigNum {
@Id
@Column(name="ID", nullable=false)
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="bigNumSeq")
private Long id;
@Column(name="NUM")
private BigDecimal num;
public Long getId() {
return id;
public void setId(Long id) {
this.id = id;
public BigDecimal getNum() {
return num;
public void setNum(BigDecimal num) {
this.num = num;
}3. Code that causes the problem:
BigNum bn = new BigNum();
bn.setNum(new BigDecimal("9999999999999999.00"));
em.getTransaction().begin();
em.persist(bn);
em.getTransaction().commit();So, the INSERT statement that iss generated to the database is:
INSERT INTO BIG_NUM (ID, NUM) VALUES (?, ?)
bind => [1, 9999999999999999.00]However, the database contains the following:
SQL> select * from big_num;
ID NUM
1 10000000000000000,00Can somebody tell me if it's possible to save big numbers accurately into the database? If yes, then how?
Best regards,
BisserDisabling the bind variables produces the following:
INSERT INTO BIG_NUM (ID, NUM) VALUES (2, 9999999999999999.00)The database still joyfully contains a rounded number:
SQL> select * from big_num;
ID NUM
2 10000000000000000,00So, no, it's not an issue with the bind variables. I need to examine the JDBC driver but could you tell me how I can find out what Oracle JDBC driver is used by JPA? Or... is it some other JDBC driver (not Oracle, that is)?
Best regards,
Bisser
P.S. We use the following version of TopLink Essentials:
TopLink, version: Oracle TopLink Essentials - 2.1 (Build b60-fcs (11/17/2008))
Edited by: bisser on Jan 28, 2009 9:25 AM -
My messages displays mostly numbers of contacts, not contacts, why?
I turned my iPhone 4s on today and suddenly half of my messages are displayed as numbers, not contacts. I don't understand why, I couldn't find any info in the settings section.
contact are not an issue http://thunderbirdtweaks.blogspot.com.au/2014/10/sync-hotmailoutlookcom-contacts-with.html
Calendar will continue to be a problem until Microsoft makes them available in a format that is standards based.
Google, much a I question their integrity make use of Open standards. Yahoo, even as they stumble from disaster to snafu also use standards. GMX the largest provider in Europe I am told, also uses standards. Even Apple manage to use standards. Only Microsoft stands out there using proprietary protocols that must be licensed from them. It is however a good way to ensure vendor lock in. They have no iTunes to keep the customers loyal and spending money -
How do I display something only if javascript is enabled?
Hi. This may be a dumb question, but I haven't been writing code all that long. Anyway, I am creating a custom online store. I used the spry menu bar to create a menu bar for the product categories. The tutorials I had been watching about how to use the spry widgets said that it's a good idea to create alternatives incase somebody doesn't have javascript enabled, so I created an alternative navigation system. The problem now is, I only want to display the spry menu bar if javascript is enabled. I know I can use the noscript tag to display the alternative navigation system is javascript is disabled, but how do I display something only if javascript is enabled?
I tried that and it doesn't seem to be working. I tried it as:
<div id="navigation">
<script>
<?php publicNavigation(); ?>
</script>
<script type="text/javascript">
<!--
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
//-->
</script>
<noscript>
<?php
startNavigation();
?>
</noscript>
</div>
and as:
<div id="navigation">
<script type="text/javascript">
<!--
<?php publicNavigation(); ?>
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
//-->
</script>
<noscript>
<?php
startNavigation();
?>
</noscript>
</div>
In either situation, nothing shows up where the menu bar should be. I know I have javascript enabled so that is not the problem. How do I get this working? -
Problem with displaying any picture at all.
Hi there, one of my iMacs has a problem with displaying video.
When I turn the computer on the screen shows a yellow-orange hue in the centre, and it's getting wider across the screen and bright, eventually it turns to a white screen. Now I know for a fact it's nothing to do with the logic board! I can control the computer with remote desktop and dim the screen or make it brighter. My question is, is it the cabling that is faulty or something else?
If it's the cabling, how can I open the chrome neck and change it?
Thanks youDid your testing include utilizing a second display and adapter to see
how a mirrored output of the video would appear; to be sure this item
is isolated to the wiring from the circuit boards to the attached LCD?
There are components within the border of the iMac G4's display which
may affect the image as they wear out and/or fail. The inverter, is one
item that is in the panel along with the backlight and liquid crystal layer.
Removing or replacing the wire harness between these components,
the computer base and LCD panel, is a bit of work. This topic has been
addressed in these forums at one time or another; and a few owners
who contribute here have experience taking these apart. In the past,
getting a known-good display with chrome arm and harness, from an-
other iMac (perhaps one with logic board failure) and combine two,
was an answer when the complete display & arm were known good;
as this saved a fair amount of work on the upper end. Still, taking the
lower orb shape apart is a significant task; to have it work right again.
The cabling could be faulty; the inverter could be. And there may be
yet another associated component failing which produces symptoms.
Taking apart the chrome arm may not be such a good idea; I've seen
the expanded view of one taken apart by a metal cutting saw, and it
has a big spring inside, and a bit of tension. There also are friction pad
parts inside that loose their ability to hold up the panel, so some owners
sought to replace those to varying degrees of trouble.
There should be a few step-by-step instructions. One of the contributors
to the iMac G4 forums here was Mr Totes; one of his web pages had a
few images of take-aparts he'd done. Other sites had basic stuff, such
as replacing optical drive and hard disk drives, thermal paste, RAM, etc.
If you were able to see the correct system images from a second display
via the VGA adapter cable, in mirror mode, the attached unit certainly is
suspect; and the computer is probably repairable. Otherwise, there is a
video component on the logic board not considered a separate part; and
if that fails, the usual fix is to get a reman logic board or another iMac.
Have fun, whichever way it goes.
Good luck & happy computing! -
i bought a iphone 3gs 4 months ago had a problem with display service centre replaced me with the phone when i checked the settings of the phone in cellular usage under call time the lifetime usage was 3 days and 18 hours.what sholud be done ?
How is your iPhone's display different?
You can check the model number by going to Settings/General/About. These are the model numbers for the various 3 GS models;
MB715LL/A (16 GB Black), MB716LL/A (16 GB White), MB717LL/A (32 GB Black), MB718LL/A (32 GB White), MC555LL/A (8GB) -
Hi,
Ive been taking a look through these forums and have seen plenty of these posts but I have noticed something alarmingly different with my router stats.
To fill you in due to my distance friom the exchange the best speed that I can get at the moment is 2mb d/l, I understand the reason why and have learnt to live with it. My problem is that for the last week or so i have dropped down to 0.3mb which is very very poor in my opinion. I have contacted Technical Support and got nowhere really, but after reading through the forum i decided to take a look at my router stats to see how they compared and as the title says there are some very big numbers there and i was hoping that one of you helpful fellows might have a better idead than me (or Technical Support) what is going on with my connection.
Thanks.
ADSL line status
Line state
Connected
Connection time
0 days, 9:28:13
Downstream
2,336 Kbps
Upstream
448 Kbps
ADSL settings
VPI/VCI
0/38
Type
PPPoA
Modulation
ITU-T G.992.1
Latency type
Interleaved
Noise margin (Down/Up)
11.5 dB / 14.0 dB
Line attenuation (Down/Up)
59.0 dB / 31.5 dB
Output power (Down/Up)
16.7 dBm / 12.3 dBm
Loss of Framing (Local)
2
Loss of Signal (Local)
2
Loss of Power (Local)
0
FEC Errors (Down/Up)
164264 / 22
CRC Errors (Down/Up)
1128 / 2147480000
HEC Errors (Down/Up)
nil / 10
Error Seconds (Local)
304This Test comprises of Best Effort Test: -provides background information.
Download Speed
0 Kbps
0 Kbps
500 Kbps
Max Achievable Speed
Download speedachieved during the test was - 0 Kbps
For your connection, the acceptable range of speeds is 50-500 Kbps.
Additional Information:
Your DSL Connection Rate :2336 Kbps(DOWN-STREAM), 448 Kbps(UP-STREAM)
IP Profile for your line is - 350 Kbps
As i said it has got worse this morning but maybe not as bad as 0kbps but its bad. Also edit is taking an age which is why Ive made 2 new posts. -
Wi-Fi Connection Time Displays Negative Numbers
Using an AEBS with the latest firmware 7.6.2 and OS X 10.7.2. The Wi-Fi connection time appears to randomly start displaying negative numbers. It then counts down (up?) to zero and then displays positive numbers. Anyone else seen this?
Regards.I have the same problem (Macbook 2008, 10.6.8 airport extreme 7.6). Has there been a fix? How do I report this bug, which seems to be affecting older machines as well? It's somewhat amusing, but is starting to become annoying.
Melinda -
My WiFi signal is displaying negative numbers instead of signal strength.
Recently my Ipod 3rd gen. has been getting real weird with the wifi. first, it would always lose signal whenever i would do anything, like watch videos or open an app that required wifi. if i moved a couple feet it'd start to connect again. Then it started displaying a "-87" where the wifi signal would be. and the number would either increase or decresase, until i tried doing something that requird wifi. at first it would only come on whenever i restarted my ipod and itd quickly lose signal. ive restorede my ipod 3 times today, dumped everything. ive tried jailbreaking it to see if itd refresh files or anything. im not sure what to do anymore. ive looked for hours online and cant seem to find anyone with this problem. Any suggestions or ideas? without me buying a new one. i don't have a warranty..
Message was edited by: jbiggie1130Interesting. The -87 refers to signal strength in db, which I believe are decibels. The lower the number, the stronger the signal.
However, iPods don't display these numbers unless you have jailbroken the device or are using an app like WiFinder (since removed from the App Store).
And since you have jailbroken the device we can't, by the terms of service of this site, offer you any advice other than to refer you to help article on WiFi: http://support.apple.com/kb/TS1398 -
I am having problems because two phone numbers are on the Apple ID, how do I choose one for imessage?
Hello,
In my opinion, this is the best procedure to use to update your BB OS:
http://supportforums.blackberry.com/t5/BlackBerry-Device-Software/How-To-Reload-Your-Operating-Syste...
However, the official download site:
http://us.blackberry.com/support/downloads/download_sites.jsp
shows your installed OS to be the current version from your carrier. Therefore, how your friends got a newer OS is a question to ask them and/or your carrier.
You are, of course, free to use (via the above procedure) any carriers OS package...if another has the newer OS you want, you can use it. If you choose to do so, then simply insert, between steps 1 and 2 in the above procedure, the deletion, on your PC, of a file named VENDOR.XML
Good luck.
Occam's Razor nearly always applies when troubleshooting technology issues!
If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
Join our BBM Channels
BSCF General Channel
PIN: C0001B7B4 Display/Scan Bar Code
Knowledge Base Updates
PIN: C0005A9AA Display/Scan Bar Code -
Problem in displaying the TaxRate columns .
Hi Experts,
I am having a problem in displaying the 'TaxRate', in this Query there are some different Taxrate's columns like- ' 'Basic Excise Duty BED@10 %', ' Education ces@2% ' , 'Secondary Education Cess @1%', etc. only 4 -5 tax's value should display at a time and rest of the TaxRate's columns whose value is NULL should not display.
So, I want to display only those TaxRate's columns whose value is not NULL and If there is no value for any taxrate's column in the data, then it should Display only 'Excempt' column.
This is my query...
SELECT DISTINCT OSTA.Code , ORPC.DocNum AS 'Debit Note No.', ORPC.CardName AS 'Name', ORPC.CardCode AS 'code', ORPC.NumAtCard AS 'Supplier Ref.' ,
RPC1.Dscription AS 'Description of Goods', ORPC.Address, RPC1.Quantity, RPC1.Price AS 'Rate', RPC1.LineTotal AS 'Amount', ORPC.DocDate,
(SELECT DISTINCT TaxRate
FROM RPC4
WHERE (staType = - 90) AND (StaCode = 'BED@10') AND (DocEntry = RPC1.DocEntry)) AS 'Basic Excise Duty BED@10 %',
(SELECT DISTINCT TaxRate
FROM RPC4 AS RPC4_8
WHERE (staType = - 60) AND (DocEntry = RPC1.DocEntry)) AS 'Education Cess @2%',
(SELECT DISTINCT TaxRate
FROM RPC4 AS RPC4_7
WHERE (staType = - 55) AND (DocEntry = RPC1.DocEntry)) AS 'Secondary Education Cess @1%',
(SELECT DISTINCT TaxRate
FROM RPC4 AS RPC4_6
WHERE (staType = 4) AND (StaCode = 'CST2') AND (DocEntry = RPC1.DocEntry)) AS 'Central Sales Tax(CST)',
(SELECT DISTINCT TaxRate
FROM RPC4 AS RPC4_5
WHERE (staType = 1) AND (StaCode = 'VAT4') AND (DocEntry = RPC1.DocEntry)) AS 'Input VAT@5%',
(SELECT DISTINCT TaxRate
FROM RPC4 AS RPC4_4
WHERE (staType = 1) AND (TaxRate = 12.500000) AND (StaCode = 'VAT12.5') AND (DocEntry = RPC1.DocEntry)) AS 'VAT12.5%',
(SELECT DISTINCT TaxRate
FROM RPC4 AS RPC4_3
WHERE (staType = 18) AND (StaCode = 'Add2') AND (DocEntry = RPC1.DocEntry)) AS 'ADD Tax 1%',
(SELECT DISTINCT TaxRate
FROM RPC4 AS RPC4_2
WHERE (staType = 7) AND (DocEntry = RPC1.DocEntry)) AS 'Excempt'
FROM OSTA INNER JOIN
RPC4 AS RPC4_1 ON OSTA.Code = RPC4_1.StaCode CROSS JOIN
ORPC INNER JOIN
RPC1 ON ORPC.DocEntry = RPC1.DocEntry
WHERE (OSTA.Code IN ('BED@10','eCess 2%','HeCess 1%','CST')) AND (ORPC.CardCode = 'V00308') AND (ORPC.DocNum = '9220004')
Kindly help me to solve this problem
Regards
RahulHi rahul,
Try this:
SELECT DISTINCT T0.DocNum AS 'Debit Note No.', T0.CardName AS 'Name', T0.CardCode AS 'code', T0.NumAtCard AS 'Supplier Ref.'
,T1.Dscription AS 'Description of Goods', T0.Address, T1.Quantity, T1.Price AS 'Rate', T1.LineTotal AS 'Amount', T0.DocDate,
(SELECT DISTINCT ISNULL (SUM(RPC4.TaxRate),0)FROM RPC4 WHERE RPC4.StaType = -90 AND RPC4.DocEntry = T0.DocEntry) AS 'Basic Excise Duty BED@10 %',
(SELECT DISTINCT ISNULL (SUM(RPC4.TaxRate),0) FROM RPC4 WHERE RPC4.StaType = -60 AND RPC4.DocEntry = T0.DocEntry) AS 'Education Cess @2%',
(SELECT DISTINCT ISNULL (SUM(RPC4.TaxRate),0) FROM RPC4 WHERE RPC4.StaType = -55 AND RPC4.DocEntry = T0.DocEntry) AS 'Secondary Education Cess @1%',
(SELECT DISTINCT ISNULL (SUM(RPC4.TaxRate),0) FROM RPC4 WHERE RPC4.StaType = 4 AND RPC4.StaCode = 'CST2' AND RPC4.DocEntry = T0.DocEntry) AS 'Central Sales Tax(CST)',
(SELECT DISTINCT ISNULL (SUM(RPC4.TaxRate),0) FROM RPC4 WHERE RPC4.StaType = 1 AND RPC4.StaCode = 'VAT4'AND RPC4.DocEntry = T0.DocEntry) AS 'Input VAT@5%',
(SELECT DISTINCT ISNULL (SUM(RPC4.TaxRate),0) FROM RPC4 WHERE RPC4.StaType = 1 AND RPC4.StaCode = 'VAT12.5'AND RPC4.DocEntry = T0.DocEntry) AS 'VAT12.5%',
(SELECT DISTINCT ISNULL (SUM(RPC4.TaxRate),0) FROM RPC4 WHERE RPC4.StaType = 18 AND RPC4.StaCode = 'Add2'AND RPC4.DocEntry = T0.DocEntry) AS 'ADD Tax 1%',
(SELECT DISTINCT ISNULL (SUM(RPC4.TaxRate),0) FROM RPC4 WHERE RPC4.StaType = 7 AND RPC4.DocEntry = T0.DocEntry) AS 'Excempt'
FROM ORPC T0
INNER JOIN RPC1 T1 ON T0.DocEntry = T1.DocEntry
WHERE (T0.CardCode = 'V00308') AND (T0.DocNum = '9220004')
FOR BROWSE
Thanks,
Neetu
Maybe you are looking for
-
Whenever I open Mail.app, my iMac crashes after a while.
Hi guys, whenever I open Mail.app on my iMac (Mid 2010, OSX 10.8.2) crashes like I suddenly lost power. Did anyone expirience such a problem before? The iMac runs fine, currently I'm using Thunderbird without problems. What I alread did: - Reinstall
-
I want to erase my mini hard drive. where do I get a new operating software
I want to erase my mini hard drive. Where do I get a new operating software to reinstall on the wiped hard drive?
-
I'm trying to turn voice over off but its nt letting me put my passcode in and the bubble isnt turning white when i put passcode in. When i put my passcode in i can hear voice over saying my passcode. HELP??
-
User defined table type output not coming
hi all, i have a userdefined type delcared as: create or replace TYPE SAMPLE_SEARCH AS OBJECT ( -- LIST OF VARIABLE NAMES AND RESPECTIVE DATA TYPE i have a user defined table type defined as: create or replace TYPE SAMPLE_SEARCH_TABLE IS TABLE OF SAM
-
Can someone tell me how to import c.d's faster. I've already tried all the stuff they told me to do on the help menu. edit, pref., general, import settings, deselect "use error correction when reading audio c.d.s. It wasn't even selected in the fi