yii2 - formatter currency to number - yii2

I have an input like this 500,000,000.00 named modal
In database, it should be 500000000.00
How can I suitable my input to database somtehing like formatter :
$this->modal = Yii::$app->formatter->asCurrency($this->modal);
but not works.
Please advice
Thanks

you should be remove , from you number before converting to currency
you can do like it
Yii::$app->formatter->asCurrency(str_replace(',', '',$this->modal));

Related

Node JS dosen't update date picker from Mongo DB

I want to update certain fields in Node JS and I get value for all string fields.
enter image description here
But I cant get display value in date picker control. When I inspect element I get that value in value field of HTML.
Something. I didnt find answer
you can use moment js libary https://momentjs.com
and the solution will be
// you can enter the value of the date in the moment(value from mongodb) function
moment("2012-11-22T12:54:43.852Z").format("YYYY-MM-DD")

Acf function in python

I'would like to ask about the interval of confidence in python :
I don't understand what is the difference between the estimateur of acf and the acf it self they are both calculated by the same way here ?
Thanks.
enter image description here

Hide JsonValue from log file using <flter-spec>

I'am trying to hide the Json value of the student field from log files using filter-spec,
this is my filter-spec :
after i applied the flter this is how the data is showing in the log file
all i want it is to replace ("student" : "testStudent") with ("student": "****") instead it is got replaced with ("student: ****)
does anyone have an example on how to hide the json value using filter-spec?
Thanks in advance
It is not actually possible replace a JSON value with a filter. You'd need to use a custom filter or custom handler in order to do this.
You could file a feature request though. It does seem like a decent idea for a filter to be able to filter values in structured formats.

Set Value of form field as current date in JHipster

We are trying to set default value of form field as current date in Jhipster.
Now, jhipster provides a moment format to a date which is eventually a ngbdatepicker. If we try to change the input type to "date" we cannot assign moment instance with date. If we typecast new date object as moment, the template shows error messages.
Please let us know if its possible.
Thanks in advance.
I have found a way around to solve this problem:
All you need to do is typecast your standard date object to moment after importing the moment obviously:
import * as moment from 'moment';
and typecast your field something like
your_form_field = moment(new Date());
Eg:
this.mstSite.siteUpdatedOn = moment(new Date());
Hope this solves your problems.
...Cheers...

how can i compare my textbox value to my database using ASP.net

I am trying to make a login page,for this on the login page the text box value should be same as in my database,how to apply the logic for this ,using the ASP.net
You have to be a bit more specific as to what it is you're wanting, how you retrieve data from the database, and so on.
Basically, after retrieving the field from the database, do a comparison. Something like this...
Suppose the textbox is called txtUsername and the field in the database table is username, you'd do something like
if (txtUsername.text == db.username)
{
// Do something
}
Hope this helps. Otherwise, more details is needed to answer the question correctly.