Can anyone tell me how to display something like this in wordpress? I know the SQL code for it, just not how to display it in Wordpress. Ive tried to google plug ins etc with no luck.
You can try NUMBER_FORMAT or MONEY_FORMAT functions of PHP and format your data before displaying it on page. You do not need to rely on sql.
Number Format
Money Format
If you insist using sql and try showing data as it comes from database you can query your data as shown below.
FORMAT()
CONCAT('$', FORMAT(VAL, 2))
I'm not quite familiar with wordpress html editor but I think you can do something like this:
Make an <input> field with text type, remove the borders and set as read-only. Then send the value from sql query - make sure the value looked exactly as you want it - according to your example there, the value should be '$6,621,280'. Use that value to show in the <input> field.
Refer to this jsfiddle example : https://jsfiddle.net/6vqhc1sL/3/
Related
I am thinking of creating some sort of calculation method on a Fandom wiki page, but I am struggling to find out how to create an input box that the user can input numbers for the calculation.
Only thing I found is InputBox, but this seems to be hard-wired to specific functionality on the wiki, and not for custom use.
Someone told me about some sort of field template, but I was not able to get that to work.
It was something like this:
{{{field|test|input type=number}}}
Result: {{#expr: {{{test|0}}} + 5}}
This was supposed to work as generating an input field named "test" of type=number and using the result in a calculation. I got the expr calculation itself to work, but no input field was generated. It just showed a static text "test" and the value of the expr result was "5".
Anybody know if somethings like this is possible to acheive in a Fandom wiki page?
Note:
I do have administrator privileges on the wiki where I need this.
How to convert Text on a SSRS report to Title Case.
Right now I am using
=Strconv(Fields!Title.Value, 3)
Which works but in some cases eg.: GEORGIA(GA) is the text coming from DB its converting it to Georgia(Ga). I want it convert like Georgia(GA). I think some kind of Regular expressions need to be used, But I'm not sure how to do that.
Is there a way to achieve this from a inbuilt SSRS functions or Writing custom method is the only way?
Any kind of help is much appreciated. Thanks! :)
This will display GEORGIA(GA) as Georgia(GA):
=StrConv(Left(Fields!Title.Value, InStr(Fields!Title.Value, "(") - 1), 3)
& Right(Fields!Title.Value, InStr(StrReverse(Fields!Title.Value), "("))
Basically it's splitting the string in two based on (, applying StrConv to the left side then concatenating the two strings back together.
Maybe not the most concise code ever but does the job with native SSRS functions.
I inserted three text boxes to test how this could work:
Text81: =1
Text82: =2
Text83: I want this one to be the sum of Text81 and Text82
Thanks in advance for your help on what I think is a pretty simple problem.
There are a couple options that spring to mind.
First you could always modify the data source for the report to include the calculated field.
Second, which is what your question drives at, you can do something like this:
=[Text81] + [Text82]
Should work when typed into the Control Source of a TextBox provided Text81 and Text82 are the data field names from the Data Source of the Report. If they are not you would put the corresponding data field names in the square brackets []
Hope this helps
I'm trying to display the sum of a field in a text box in the form footer. The field is not calculated in any way.
Here are a couple of the things I've tried:
=Sum([txtWeldInches])
=Sum([WeldInches])
=Sum(CDbl([txtWeldInches]))
=Sum(CDbl([WeldInches]))
...well you get the idea. Each iteration I've used results in the Text Box displaying #Error Without exception.
I've used similar constructs in different forms in the same project, so I'm not sure what the problem might be.
Has anyone run into this before?
EDIT:
I ended up writing a VBA routine to update the boxes when it was likely that they would be changed rather than trying to get a bound sum() function to work.
http://support.microsoft.com/kb/199355
All of the domain functions are based on the same query (over the underlying recordset). If one of the bound functions on the form has a binding error, all of the functions on the form will return an error.
In other words, make sure all your footer controls are resolving properly and not hitting any nulls.
If you use a SUM or AVG then make sure you are also using the Nz function:
ControlSource = =SUM(NZ([FIELD],0))
Is the field "WeldInches" existing in the data source for this form?
What datatype the field "WeldInches" is?
EDIT: I have looked at all your comments. If it doesn't work by databinding, try and use the unbounded way. At runtime, get the value of WeldInches using DSUM and set the footer textbox's value when the form loads.
Also, remember to update it at places where you think the SUM could change.
I had the same problem as Rister.
The source of the form was an underlying query.
I had a bound text box named txtQty on this form. Its control source was Qty (based on the underlying query of the form).
I created an unbound text box and entered =SUM([txtQty]) and received an error.
I tried various ways to find a solution and was very desperate.
Then I deleted the underlying query and created a new one using the same name and fields as before.
Then I entered =SUM([Qty]) into the unbound text box on the form and voila, it worked. Note that I didn't enter the name of the bound text box (txtQty) into the expression, but its control source (Qty). I don't know why, but it worked for me.
I know you said "Form" but for those who have issues with the Sum formula in an Access "Report" the formula has to be in the Report Footer NOT the Page footer. Took me a while to figure it out as Access defaults to only showing the page footer.
You want to sum by the name of the column in the record source: SUM([WeldInches])
Make sure there are no other textboxes with the name WeldInches.
I have some fields I currently populate with a P0. The results is like this:
2,434%
I want however something like this:
2434%
How do I do this?
Have you tried something like 0000%? Or alternatively, an expression like:
=right(format(Fields!YourField.Value,"#%"),5).
I don't have BI studio open right now so I can't test these. The expression would of course convert the value to text, which maybe problematic when you export the report to excel.
####%
Note: Unfortunately, this does not lock down to a max of 4 characters (like I would expect/wanted), but it's close enough.