Set decimal separator when using f:convertNumber

The default decimal separator depends on the locale used. You can set it in 2 ways: On a per-view basis by the locale attribute of the <f:view> tag: <f:view locale=”#{bean.locale}”> On a per-converter basis by the locale attribute of the <f:convertNumber> tag: <f:convertNumber locale=”#{bean.locale}” /> It’s unclear what locale you’re targeting, but the use of … Read more

Adding Thousand Separator to Int in Swift

You can use NSNumberFormatter to specify a different grouping separator as follow: update: Xcode 11.5 • Swift 5.2 extension Formatter { static let withSeparator: NumberFormatter = { let formatter = NumberFormatter() formatter.numberStyle = .decimal formatter.groupingSeparator = ” ” return formatter }() } extension Numeric { var formattedWithSeparator: String { Formatter.withSeparator.string(for: self) ?? “” } } … Read more

HTML + CSS: Ordered List without the Period?

This is perfectly possible to do with just CSS (2.1): ol.custom { list-style-type: none; margin-left: 0; } ol.custom > li { counter-increment: customlistcounter; } ol.custom > li:before { content: counter(customlistcounter) ” “; font-weight: bold; float: left; width: 3em; } ol.custom:first-child { counter-reset: customlistcounter; } Keep in mind that this solution relies on the :before pseudo-selector, … Read more

Separators for Navigation

If there isn’t a pressing need to use images for the separators, you could do this with pure CSS. nav li + li:before{ content: ” | “; padding: 0 10px; } This puts a bar between each list item, just as the image in the original question described. But since we’re using the adjacent selectors, … Read more

tech