I'm trying to create an aggregation for my open graph action using the number layout. It needs to have two decimal places. My object, 'location', has property 'rtw' of type Float.
In the create aggregation screen in the number field I have {location.rtw | currency} which should format the float to 2 decimal places according to this document: https://developers.facebook.com/docs/opengraph/template/
However it seems to round it instead of showing decimal places, so my float of 1.54 becomes 2.
Am I doing something wrong here?
The Open Graph offers a choice of Layout Styles for aggregations:
The Open Graph Layout Style called "Number" - the layout you have chosen - always display the aggregation in its headline as an integer. This is by default and can't be changed. It appears to be an aesthetics-based choice on Facebook's part.
The headline aggregation can be a sum, min or max value, but even if the individual values are of type float the aggregation will be of type integer.
See this screenshot example, taken from the Layout style section of the Define Aggregations page on Facebook Developer. The sub-items that can be displayed as part of your aggregation display float values but the Headline number displays an integer:
Here, the total distance run 82.42 (45.06 + 25.56 + 11.8) is converted to the integer 82 in the headline sum, although each individual distance run is a float.
Net, if a developer chooses the Number Layout Style, he has to make sure that the aggregation makes sense in integer form.
There is the option to add a caption line to the aggregation which can contain a float, e.g "ran 82.42 miles in 10 hours".
The individual posts you make with your app can display a float in its headline. E.g. "just ran 25.56 miles in 3 hours".
You can explore the other Open Graph Aggregation layout styles if it is important for you to display a float in the headline. For example, the Map Layout supposedly supports displaying a float in its headline (here displaying a max value):
If the property name is rtw you should only write:
{rtw|currency}
It would be nice to have some more number formatting though. The default display of floats changed a few weeks ago as well. It used to round automatically, but now shows 2 decimals.
My movie rating app used to show 3/5 stars or 2.5/5 stars, but now shows 3.00/5 stars or 2.50/5 stars.
Related
I'm trying to put together a story and I'm starting to create the first pages with graphics. The graphs are based on tables that are in S4/HANA and have the format as shown in the first image but with more fields, in each line there are weeks (repeated, although they do not appear like that in the photo) and that week will have a condition; "SI" or "no".
When creating a graph I can represent the amount (y-axis) against the condition and the week (x-axis) and it would look like this (2nd photo). In addition to this, I would like to add another bar per week that represents the TOTAL, the sum of condition = "SI" and condition = "NO". Is it possible to do this from SAP Analytics Cloud or do I have to rack my brain changing the lines of the source table adding a total there?
As a clarification, I do not need to add 2 different numerical fields or anything, I would simply like to add the SIand NO of the condition column, if on the y-axis I put volume that represents volume and if I put amount that represents amount, but I am looking for a third bar With the total, I don't know if I explained myself well.
Thank you very much in advance, if you help me solve this I would be very grateful, greetings
https://ibb.co/dcCKKzF
https://ibb.co/kDN3ZXp
Its value property is a type of integer. I could not find what its range is, but it seems it is 0 to 100. So, if I set a value like 50, it displays a half-full progress bar. But what if I want to display fractional percentages like "99.9"? Does CellRendererProgress have something like fractional mode? Or is there a different renderer that can take fractional values?
I did a quick review of the "CellRendererProgress" widget by reviewing the GTK source code for the widget and it indeed expects an integer value from zero to one hundred. It does not allow for a fraction as does a regular progress bar. Technically, the range for a progress bar widget is from zero to one, but the "fraction" element is a "double" so a fraction of ".999" (99.9%) would work with it. If you are keen on creating your own custom cell renderer that contains a progress bar in lieu of using the "CellRenderProgress" widget, I did a bit of searching on the web and found this link.
"https://blogs.igalia.com/csaavedra/documents/treeview-tutorial/sec-custom-cell-renderers.html"
You might be able to base a custom cell renderer widget with an embedded progress bar on this example. Bear in mind, this code was written for GTK2, so some tweaking would need to be done.
Regards.
If I use Standard format for a number in a control then I can Align Right and it appears on the far right of the control in the Form. However, I am using numbers in millions and so want to format the number so that, for example, 50,123,456 will appear as 50.123. So I use format #,,.0 with decimal places set to 3. If I set alignment to left, it aligns to the left of the field on the form, Align Center and it appears in the center. But Align Right and there is a large space to the right of the number, like padding. Is there a way to get the formatted number to hit right up to the right side on the form?
Replace the ControlSource with the expression:
[Amount]/1000
Set property Format to: Fixed
Set property DecimalCount to: 0
The formating option might not be the right approach to getting the needed solution. Do the following instead
Put the format to general number.
Put the decimal places value to 0.
Then go to VBA and add the following code to the after update event of the control
Private Sub allocatedamount_AfterUpdate()
Me.allocatedamount = Left((Me.allocatedamount / 1000000), 6)
End Sub
In this case i added the code to the after update evnt of the control on the form named allocatedamount
I have attached two images.
This code will work for numbers between 10 million and 99 million, where it is between 100 million and 999 million you will have to add another zero to the constant 1000000 used in the VBA code,so that will entail using an If statement to first determine if the value is between 10 million and 99 million or 100 million to 999 million.
(source: tableau.com)
I'm using Measure Values for combining two measures:
1)Count of Clients (As a percentage)
2)% Retention (Calculated field which uses another calculated field called Numerator Retention in it's formula over the total to calculate the %)
Measure Value Mark Labels successfully show the respective percentages for the two measures. Now I wanna show the respective count of clients or numbers behind these percentages but I'm unable to do so since I've already used Measure Value Mark Labels to do something similar.
When I try editing the Labels text, it edits it for all labels together and hence I'm getting all labels for all rows and not how I want it to show selectively as I described.
Example Solution: For Private Residence, I only want 125 to show with 60% which is the actual number behind the percentage. And I want only 119 to show with 95%
You can do this, but not using Measure Values. You should mirror what I have done here. I do not know your calculation for the Respective Retention, so use your calculation.
You need to move both of your measures to the Columns shelf and make them a Dual Axis:
After doing that, you will have access to the individual measures - so you can give labels independently:
Just make sure you place the measures that you want for each axis respectively.
The way I understand how emacs displays stuff is that essentially everything is text. If you have something in the fringe or linum mode active, essentially your document is pushed a little inwards and something is written in the first few columns.
I'm writing a function for putting some stuff into the head-line and this works nicely, however, I would like the start of the text to be aligned with the start of the document.
Thus I am looking for a way to get the number of columns that sit between the frame border and the start of the actual document.
Let me illustrate using a poorly produced graphic:
I want to get the number of columns (or the number of pixels) that make up the distance marker by the ruler just below the line number 10000.
The function which returns this value shall be executed in the functions which create the head-line.
There is a function called window-inside-edges that you can use to determine the offset of the text area ("window body") from the total width and height of the window in columns and lines, respectively.
It returns a list four values; the order is left - top - right - bottom, so to get the value you are interested in for the current window, just do
(car (window-inside-edges))
More information on window coordinates can be found here; this page has information about window sizes, including a nice ASCII representation of window elements.