I have seen plenty of questions on how to round to two decimal places using Math.Round(), but not when using placeholders. This is my best attempt but the program is still giving me around 14 decimal places:  Console.Write("\n\nPercentatge Weight: {0}% ",      G[ArrayCount] * 100 / RayTotal,     Math.Round(RayTotal, 2));   After this runs I am getting a percentage such as 14.3256941565.  I just want it to be 14.33  Should add that I don't already have the value it is dependent on what the user enters.
When displaying the value of a decimal currently with .ToString(), it's accurate to like 15 decimal places, and since I'm using it to represent dollars and cents, I only want the output to be 2 decimal places.   Do I use a variation of .ToString() for this?
Proofs involving $ (A\setminus B) \cup (A \cap B)$ Metapost label based on variable value I want to label a scale based on a variable value and I wrote a metapost code like this.  $ := 1; for i = -.3cm step .6cm until 3.6cm:     label.bot(str$,(i,-3.7cm));     $ := incr($); endfor;   It just labels "$" instead of its value. How to output the variables value? How could it be that the entropy of gas is not infinite?  If we use the formula $S=k\ln(\Omega)$ we get infinity because there are an infinite number of possible situations (because there are infinite possibilities of position and momentum for each molecule). Can you attach a UIGestureRecognizer to multiple views? The search parameter isanswered ignores acceptances The SE definition of "answered" question is: has an answer that is either accepted or has positive score. But the search parameter isanswered appears to ignore the "accepted" clause: when set to "no" it still returns questions with an accepted answer, as long as it has 0 score.    to reproduce the bug (unless meta effect kicks in and the answers get upvotes).     By the way, it seems that isanswered works only when is:question is present, but I'm not complaining about that... yet.   Also, this parameter is not listed on the , but I'm not complaining about that either... yet. What's the best way to get the last N elements of a Perl array? Show that function $f$ has a continuous extension to $[a,b]$ iff $f$ is uniformly continuous on $(a,b)$ Let $E \subset F \subset X$ and $f:E\rightarrow Y$. We say that the function $g:F\rightarrow Y$ is an extension of $f$ if $g(x) = f(x)$ for all $x \in E$.   Let $f: (a, b) \rightarrow \mathbb{R}$. Show that $f$ has a continuous extension to $[a, b]$ if and only if $f$ is uniformly continuous on $(a, b)$.   $(X,d)$ is a metric space.  Hint: To prove $\Leftarrow$ start by showing that $f$ maps Cauchy sequences to Cauchy sequences. Then how should you define $g(a)$ and $g(b)$?  The $\Rightarrow$ part of the proof was quite simple, but even with the hint, the other way seems a bit difficult. Doesn't the first part of the "hint" follow from the way we defined $f$? If so, how do I prove this? Help/Hints appreciated! Allowing line break at ',' in inline math mode? In the inline math mode ($...$), if the formula is too long, LaTeX will try to break it on operators, e.g.  very long text followed by a very long equation like $a+b+c+d+e+f+g+h+i+j+k+l$ etc   may be rendered as  very long text followed by a very long equation like a+b+c+d+e+f+g+h+i+ j+k+l etc   However, the break won't happen if they are separated by commas, e.g.  very long text followed by a very long equation like $a,b,c,d,e,f,g,h,i,j,k,l$ etc   will overflow the page like  very long text followed by a very long equation like a,b,c,d,e,f,g,h,i,j,k,l etc   How to make LaTeX able to insert line breaks after a comma too? Problem with sudo apt update in Ubuntu 18.04: Post-Invoke-Success if /usr/bin/test -w /var/lib/command-not-found/ The terminal gave me these errors when updating the software with sudo apt update.    Hit:1 http://it.archive.ubuntu.com/ubuntu bionic InRelease Hit:2 http://it.archive.ubuntu.com/ubuntu bionic-updates InRelease                                                                                        Hit:3 http://it.archive.ubuntu.com/ubuntu bionic-backports InRelease                                                                                      Hit:4 http://security.ubuntu.com/ubuntu bionic-security InRelease                                      Hit:5 http://archive.canonical.com/ubuntu bionic InRelease                 Traceback (most recent call last):                       File "/usr/lib/cnf-update-db", line 8, in &lt;module&gt;     from CommandNotFound.db.creator import DbCreator ModuleNotFoundError: No module named 'CommandNotFound' Reading packages list... Done E: Problem executing scripts APT::Update::Post-Invoke-Success     'if /usr/bin/test -w /var/lib/command-not-found/ -a -e /usr/lib/cnf-update-db;       then /usr/lib/cnf-update-db &gt; /dev/null; fi'   E: Sub-process returned an error code     These are the results of sudo apt install --reinstall command-not-found  Reading package lists... Done  Building dependency tree         Reading state information... Done 0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded. Need to get 0 B/5.188 B of archives After this operation, 0 B of additional disk space will be used. (Reading the database ... 225797 files and directories currently installed.) Preparations for extracting ... / command-not-found_18.04.4_all.deb ... Extracting command-not-found (18.04.4) on (18.04.4) ... Configuring command-not-found (18.04.4) ... libdvd-pkg: Package libdvdcss2-1.4.2-1 was removed, stop processing...   When I tried the command sudo apt update again after reinstalling command-not-found, the results were the same as described in the first text block. Change location of macOS Notification Center alerts? Is it possible to change where macOS Notification Center alerts appear on the screen?  They currently appear at the top right of the screen with the menu bar:    Alerts appearing in the top right tend to cover up work I'm doing more often than not. They cover up browser tabs, toolbar icons, and window titles.  I would prefer, say, the bottom right corner of the screen.  If moving the alerts is not possible, is it possible to change the screen on which they appear? i want to create new event in SharePoint calendar list in which I have some custom columns,i tried below code but it is not working      function bookingRoomForMeeting() {         var ctx = new SP.ClientContext(appWebUrl);//Get the SharePoint Context object based upon the URL           var list = ctx.get_web().get_lists().getByTitle("MyCalendarList"); //Get the List based upon the Title         var listCreationInformation = new SP.ListItemCreationInformation(); //Object for creating Item in the List         listItem = list.addItem(listCreationInformation);         listItem.set_item('Title', $("#txt_Title").val());         var date = $("#txt_startTime").val();         var dateTime = moment(date, 'DD/MM/YYYY HH:mm a').format("MM/DD/YYYY HH:mm a");         listItem.set_item('EventDate', dateTime);         var enddate = $("#txt_endTime").val();         var enddateTime = moment(enddate, 'DD/MM/YYYY HH:mm a').format("MM/DD/YYYY HH:mm a");         listItem.set_item('EndDate', enddateTime);         listItem.set_item('EmailId1', $("#txt_EmailId1").val());         listItem.set_item('EmailId2', $("#txt_EmailId2").val());         listItem.update();         ctx.load(listItem);         ctx.executeQueryAsync(             Function.createDelegate(this, success),             Function.createDelegate(this, fail)            );     } function success() {     alert("Completed"); } function fail() {     alert("operation failed"); }   list am using is SharePoint hosted app list,can any one tell me where am going wrong? Does Thunderbolt support chaining multiple monitors to a MacBook Pro? This has always been a big want for me. I love using multi-monitor setups but only want a single laptop. Does the 2011 MBP Thunderbolt support chaining multiple monitors together? I know that you can add a monitor and say, a few hard drives, but can you connect it to 2 27" monitors and your flat screen TV (for example)? Thanks! What is the difference between building from source and using an install package? I was wondering: when installing something, there's an easy way of double clicking an install executable file, and on the other hand, there is a way of building it from source.   The latter one, downloading a source bundle, is really cumbersome.  But what is the fundamental difference between these two methods? Renewing an unused B1/B2 US visa I have a valid 5 years B1/B2 visa that was issued about 4 years ago.  I never used it as I intended to travel to work in a specific project that was cancelled.  Now, There is a similar project scheduled next year. So, I have to renew the visa as it will expire before the project's start date.  Can I renew the visa although it wasn't used (I never traveled to US) ? While studying the problem of determining the orbit of a binary star system, my astronomy notes say: "the projection of an ellipse onto a plane is still an ellipse (except the special case in which it's a segment)". How could I prove this?  EDIT: As suggested i'm adding what I know about ellipses. I know the basics of ellipses in the plane, the equation of an ellipse in a plane in cartesia coordinates, the equation of an ellipse in polar coordinates, the fact that ellipses can be obtained by the intersection of planes with a cone. In my geometry course we defined ellipses as the the points of the plane such that the ratio between the distance from a point and a line is constant and less than 1. I also know that the sum of the distances of the points of the ellipse from the foci is constant. How can we recover the Newtonian gravitational potential from the metric of general relativity? Why do I always hear remote train horn at night? This is definitely not an illusion, as many people have the same experience. I have usually lived in places miles away from train stations, which makes it unlikely to hear any train horns during the day. However at night, occasionally train horns can be heard. I hope if any one can explain the physics of this effect, like possibly sound travels faster at low temperature. create a .deb Package from scripts or binaries I searched for a simple way to create .deb Packages for things which have no source code to compile (configs, shellscripts, proprietary software). This was quite a problem because most of the package tutorials are assuming you have a source tarball you want to compile. Then I've found  short tutorial (german).  Afterwards, I created a small script to create a simple repository. Like this:  rm /export/my-repository/repository/* cd /home/tdeutsch/deb-pkg for i in $(ls | grep my); do dpkg -b ./$i /export/my-repository/repository/$i.deb; done cd /export/avanon-repository/repository gpg --armor --export "My Package Signing Key" &gt; PublicKey apt-ftparchive packages ./ | gzip &gt; Packages.gz apt-ftparchive packages ./ &gt; Packages apt-ftparchive release ./ &gt; /tmp/Release.tmp; mv /tmp/Release.tmp Release gpg --output Release.gpg -ba Release   I added the key to the apt keyring and included the source like this:  deb http://my.default.com/my-repository/ ./   It looks like the repo itself is working well (I ran into some problems, to fix them I needed to add the Packages twice and make the temp-file workaround for the Release file). I also put some downloaded .deb into the repo, it looks like they are also working without problems. But my self created packages didn't... Wenn i do sudo apt-get update, they are causing errors like this:  E: Problem parsing dependency Depends E: Error occurred while processing my-printerconf (NewVersion2) E: Problem with MergeList /var/lib/apt/lists/my.default.com_my-repository_._Packages E: The package lists or status file could not be parsed or opened.   Has anyone an idea what I did wrong?  UPDATE 2012-03-06: Just a a hint for another person who is searching for a easy way to create DEBs: Take a look at . If $A$ an integral domain contains a field $K$ and $A$ over $K$ is a finite-dimensional vector space, then $A$ is a field. Issues Doing a String Comparison in LINQ