Skip to content

Commit

Permalink
Merge pull request #2983 from ControlSystemStudio/number_array_fmt
Browse files Browse the repository at this point in the history
Default format 'precision' was ignored for arrays
  • Loading branch information
kasemir authored Mar 22, 2024
2 parents dc5181c + 7765c71 commit 7348f9b
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2015-2022 Oak Ridge National Laboratory.
* Copyright (c) 2015-2024 Oak Ridge National Laboratory.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
Expand All @@ -19,6 +19,7 @@

import org.epics.util.array.ListNumber;
import org.epics.vtype.Display;
import org.epics.vtype.DisplayProvider;
import org.epics.vtype.VBoolean;
import org.epics.vtype.VDouble;
import org.epics.vtype.VEnum;
Expand Down Expand Up @@ -62,9 +63,9 @@ public static int actualPrecision (final VType value, int precision)
{
if (precision < 0)
{
if (value instanceof VNumber)
if (value instanceof DisplayProvider)
{
final NumberFormat format = ( (VNumber) value ).getDisplay().getFormat();
final NumberFormat format = ( (DisplayProvider) value ).getDisplay().getFormat();
if (format instanceof DecimalFormat)
precision = ( (DecimalFormat) format ).getMaximumFractionDigits();
}
Expand Down

0 comments on commit 7348f9b

Please sign in to comment.