Pentaho cuts double values from Table Input - pentaho

I have a Problem that I could not fix up to now. When I do a "Select" at a Table-Input the double values are not returned completely and are always cut. Here are some examples:
15.0420 => 15 // 12.6000 => 12,6 // 4.1176 => 4,1 // 0.1123 => 0,1 // 0.0012 => 0
I seems like, that minimum two numbers are shown and max one number after the comma. However it is very important to get the right figures.
I use pentaho 6.1, and mariaDB 5.5.49.
Thanks for every help.
Best regards,
Dave

Finally I adjusted the configuration of the Default Number Format. Under "Edit->Edit the kettle.properties file", I set the "KETTLE_DEFAULT_NUMBER_FORMAT" with the format '#.####'. Now it is working!

Related

Chai-sorted throws assertion error for array of numbers

I am trying to validate the values in a column to be in descending order.
All the values in the column are integers for percentage change.
It works all the times except when there is 100 for the first row.
cy.get(grid)
.find(column)
.each(child => {
cellVals.push(child.text());
})
.then(() => {
chai.expect(cellVals).to.be.sorted({ descending: true });
});
ScreenShot with the values and the Error report
Not sure whats not working. Seems pretty straight forward and don't see a reason why it's failing. Appreciate any help.
Also, is there any other way to compare in Cypress without using chait-sorted ?

Php: Saving Server resources - theoretical

(Use Laravel)
I have saved rows in my table. On updating, if I uncheck checkbox, the value must be reset to default. So my checkbox receives only checked values and I take all rows from database and set them to default first, then I set the needed value only for checked rows. This is done in 2 rows of code,
\DB::table('tablename')->where('val', '=', $id)->update(['val' => 0]);
\DB::table('tablename')->whereIn('id', $request->checked)->update(['val' => $id]);
this is one way, but for me it is awful to set all rows to default when I need to set default only not checked ones. The other option is to use foreach, which I don't like in controllers. So question 1 (theoretical and important) - Which takes more resource - huge sql or foreach? Q2 (practical) - how would you solve this problem, considering its Laravel
You could add the inverse of whereIn to your first query.
\DB::table('tablename')
->whereNotIn('id', $request->checked)
->where('val', '=', $id)
->update(['val' => 0]);

Prestashop and null fields in DB

I have a very simple piece of code :
$dropOrder = new DropOrder($dropOrderId);
$dropOrder->is_supplier_paid = $payValue;
$dropOrder->save();
It works and saves a 'is_supplier_paid' field value into the database. But it also does unexpected actions and fills all null valued fields with 0 values.
I try to save it like this :
$dropOrder->save(true);
But I still have the same strange behavior. I want to change one field only and don't touch the other ones.
Values are formated by ObjectModel::formatValue() before they are inserted / updated, based on the type of the field declared in your $definition.
You have to use TYPE_NOTHING to allow NULL values, it's the only way.
Take a look in Configuration class, with id_shop and id_group_shop fields.
PrestaShop 1.7:
I ran into the same problem in PS 1.7 and set TYPE_NOTHING is not sufficient to resolve this issue. In my case i also needed to add allow_null to true in the field's definition:
'my_field' => ['type' => self::TYPE_NOTHING, 'allow_null' => true, 'value' => null]
('value' => null is probably not necessary but suggested)

Decimal Save not Working in Rails 3.1

In my controller I am running the following code:
#place = Place.new :latitude => params[:lat].to_d, :longitude=>params[:lng].to_d
puts #place.latitude
puts #place.longitude
#place.save!
puts #place.latitude
puts #place.longitude
And the output in my server log is as follows:
37.865338226051534
-122.25851513692476
37.09024
-95.712891
I understand the fact that it is being rounded, as I used precision 15 scale 10 decimals. But why is it changing the number to a completely different value?!
Turns out the library I was using was limiting the size during a calculation.

Rails number_to_currency precision doesn't work - is it a bug?

I'm trying to use number_to_currency to get two digits after the decimal dot in Rails 3, but I can get only one. My DB field is defined like this:
t.decimal "amount", :precision => 5, :scale => 2
In my template I have:
#{number_to_currency(#purch.amount)}
And yet as the result I get: PLN 34,7
In the DB I can clearly see: 34.70
I would like to see my second zero - is it a feature or am I missing something?
Thanks!
The answer is to check the following setting in one's locale configuration file:
currency:
format:
strip_insignificant_zeros: false
Since you seem to be using a custom locale, try forcing the behavior you want by explicitly setting the options of number_to_currency:
number_to_currency(#purch.amount, :precision => 2)
You can also set these options in the locale file for your language. Take a look at http://guides.rubyonrails.org/i18n.html