Decimals not showing on template as in db

<%- if @topic_view.topic.tags.present? %>
<%= t 'js.tagging.tags' %>: <%- @topic_view.topic.tags.each do |t| %> <%= t %> <%- end %>
<% end %>

Silverstripe Version: 4.7

I need a few decimal places and managed to store them in the db as needed, but the template adds some weird numbers when I use $Pitch.Nice.

‘Pitch’ => ‘Decimal(34,30)’,


Has anybody an idea why and where those numbers come from and how to get to show only the ones in db?

I keep this question here, as it is a bit weird that those numbers get added, but if I use only $Pitch without the Nice it works even without the added 0 at the end.


Floating point numbers have usually a precision of roughly 14 decimal digits: see the big fat warning on the PHP page. If you need more precision (as in your case), you should not rely on PHP numbers.