Rake task to export default settings as seeds

This commit is contained in:
2024-12-06 01:17:05 +01:00
parent b38d72e9b0
commit 2e4eb3d4b5
7 changed files with 82 additions and 16 deletions

View File

@@ -0,0 +1,14 @@
module FixinMe
module BigDecimalScientificNotation
def to_scientific
return 'NaN' unless finite?
sign, coefficient, base, exponent = split
(sign == -1 ? '-' : '') +
(coefficient.length > 1 ? coefficient.insert(1, '.') : coefficient) +
(exponent != 1 ? "e#{exponent-1}" : '')
end
end
end
BigDecimal.prepend(FixinMe::BigDecimalScientificNotation)